In SQLCMD mode, should CONNECT be an implicit batch separator?

Posted by Greg Low on SQL Blog See other posts from SQL Blog or by Greg Low
Published on Mon, 17 Jan 2011 08:32:00 GMT Indexed on 2011/01/17 8:56 UTC
Read the original article Hit count: 276

Filed under:
Hi Folks, I've been working with SQLCMD mode again today and one thing about it always bites me. If I execute a script like: ::CONNECT SERVER1 SELECT @@VERSION; ::CONNECT SERVER2 SELECT @@VERSION; ::CONNECT SERVER3 SELECT @@VERSION; I'm sure I'm not the only person that would be surprised to see all three SELECT commands executed against SERVER3 and none executed against SERVER1 or SERVER2. If you think that's odd behavior, here's where to vote: https://connect.microsoft.com/SQLServer/feedback/details/611144/sqlcmd-connect-to-a-different-server-should-be-an-implicit-batch-separator#detail...(read more)

© SQL Blog or respective owner