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.