April 8, 2014 at 9:06 pm
Comments posted to this topic are about the item GO-ING nowhere
April 8, 2014 at 11:14 pm
INteresting question, thanks for the QotD
Hope this helps...
Ford Fairlane
Rock and Roll Detective
April 8, 2014 at 11:45 pm
Interesting question, thanks.
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
April 8, 2014 at 11:51 pm
Interesting question.
Always nice to see how Microsoft differs from other vendors (or how other vendors differ from Microsoft :-D) when it comes to terminating a simple line.
Always nice when you need to read flat files generated on a UNIX system into SQL Server... 🙂
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 9, 2014 at 1:35 am
Koen Verbeeck (4/8/2014)
Interesting question.Always nice to see how Microsoft differs from other vendors (or how other vendors differ from Microsoft :-D) when it comes to terminating a simple line.
Always nice when you need to read flat files generated on a UNIX system into SQL Server... 🙂
+1
April 9, 2014 at 7:50 am
nice question Joe.
thanks.
April 9, 2014 at 8:30 am
For both versions I got this:
Msg 102, Level 15, State 1, Line 26
Incorrect syntax near 'GO'.
"None of the above" was not an option so I knew something was off...
Did anyone else get that? I am using 2008 R2 (and changed the names to tables and fields in my test data.)
April 9, 2014 at 8:36 am
Also if I paste either result into Notepad GO is on the same line. I had a feeling this would happen, but had no idea the engine wouldn't care for one, but would for the other.
April 9, 2014 at 9:48 am
timwell (4/9/2014)
For both versions I got this:Msg 102, Level 15, State 1, Line 26
Incorrect syntax near 'GO'.
"None of the above" was not an option so I knew something was off...
Did anyone else get that? I am using 2008 R2 (and changed the names to tables and fields in my test data.)
Same here. The SSMS results window seems to convert both CR and LF to a space.
April 9, 2014 at 10:14 am
edited
April 9, 2014 at 11:01 am
sestell1 (4/9/2014)
timwell (4/9/2014)
For both versions I got this:Msg 102, Level 15, State 1, Line 26
Incorrect syntax near 'GO'.
"None of the above" was not an option so I knew something was off...
Did anyone else get that? I am using 2008 R2 (and changed the names to tables and fields in my test data.)
Same here. The SSMS results window seems to convert both CR and LF to a space.
For it to work properly you need to choose to have the results go to text rather than grid in SSMS. Then there is only one correct answer.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 10, 2014 at 1:38 am
Interesting question. Although I feel that if you need to have line feeds/carriage returns in the dynamic SQL that you are constructing, I find it better to incorporate that into the script. And it makes it a bit easier to read.. E.g.
SELECT TOP 10 'DELETE FROM [AdventureWorks2012].[Person].[BusinessEntityAddress]
WHERE [BusinessEntityID]='+CAST([BusinessEntityID] AS VARCHAR(50))+ '
GO'
FROM [AdventureWorks2012].[Person].[BusinessEntityAddress]
April 10, 2014 at 8:34 am
I guessed... Thanks, Joe!
April 10, 2014 at 12:06 pm
Nice question. I guessed the second set as well.
April 10, 2014 at 3:30 pm
Just for the record - GO is not a statement, it is a batch separator. It will be intercepted and handled by the client. Send a "GO" to SQL Server, and you'll get an error.
Proof: EXEC ('GO');
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply