Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HowTo: Release a Table variable
Message
From
14/01/2005 13:38:54
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00976391
Message ID:
00977313
Views:
31
Ok, thanks kevin. Good info to keep in mind. This has been a profitable thread.

Bill

>To wrap this up (hopefully!), I received a few responses from SQL MVPs from one of the SQL newsgroups.
>
>The consensus was that no one expected variables could be scoped in a BEGIN...END block (yet also acknowledged that BOL indicates otherwise). One person stated he might contact MS about this.
>
>The general recommendation (no surprise) was to declare local variables at the top of the procedure.
>
>In addition to Bonnie's test, someone also demonstrated that declaring the same local variable inside two different BEGIN...END blocks generated an error that the variable had already been declared.
>
>So it seems that variables inside a BEGIN...END block are created regardless. At the very least (IMHO), the docs could be a little clearer about this, and should more consistently state the actual scope.
>
>Kevin
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform