﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Kenneth Fisher  / GO Part 1 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 06:38:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Nice that you can't "GO" in a T-SQL statement.  What a nightmare that would be for anyone trying to avoid SQL Injection issues.</description><pubDate>Sat, 29 Sep 2012 13:36:18 GMT</pubDate><dc:creator>Jamie Longstreet-481950</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Great question thanks.</description><pubDate>Tue, 18 Sep 2012 05:38:10 GMT</pubDate><dc:creator>Robin Sasson</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Damn!Got the go part right, but didn't read the select closely enough.But good to remember this way to create an exponentially rising number of records in a hurry.Thank you for the question.</description><pubDate>Tue, 18 Sep 2012 00:40:06 GMT</pubDate><dc:creator>Keld Laursen (VFL)</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>The benefit of replying a few days later and fully caffeinated. :DEven so, I almost missed the INSERT ... SELECT part. :hehe:Fun question, and yes, a helpful technique for populating tables with large amounts of test data.</description><pubDate>Wed, 12 Sep 2012 17:38:08 GMT</pubDate><dc:creator>Olga B</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>good question, caught me out!</description><pubDate>Mon, 10 Sep 2012 09:17:25 GMT</pubDate><dc:creator>Yokers</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]Richard Warr (9/7/2012)[/b][hr]I looked at the first option and was disappointed that the second one wasn't[quote]Collect $200 for parsing GO.[/quote][/quote]:-DLoved the question BTW. No catch, just expected behavior.</description><pubDate>Sun, 09 Sep 2012 14:04:50 GMT</pubDate><dc:creator>codebyo</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Good question, thanks Kenneth.</description><pubDate>Sat, 08 Sep 2012 19:59:13 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>This is a good one - ending the week on a high note.  Thanks, Kenneth!</description><pubDate>Fri, 07 Sep 2012 17:38:18 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Great question. But it was a good thing I'd had my coffee/tea before I tried answering....</description><pubDate>Fri, 07 Sep 2012 12:29:56 GMT</pubDate><dc:creator>Rob Schripsema</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Nice question. I have used the GO x syntax a few times so for me it was just counting the numbers up correctly. Looking forward to part 2.</description><pubDate>Fri, 07 Sep 2012 11:53:22 GMT</pubDate><dc:creator>KWymore</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Thanks for the question.</description><pubDate>Fri, 07 Sep 2012 11:10:09 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Thanks for the question. Went for six, as I focused on the iterations, without thinking about the select returning the just inserted rows. But, as others have said, this was a good, fun question.</description><pubDate>Fri, 07 Sep 2012 09:20:12 GMT</pubDate><dc:creator>Thomas Abraham</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Excellent question, Kenneth.Almost caught by the 5, thinking it selected 1 row on every iteration.Keep these kind of questions comin'!!</description><pubDate>Fri, 07 Sep 2012 08:58:55 GMT</pubDate><dc:creator>EL Jerry</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Good question.  I always forget that you can do that.</description><pubDate>Fri, 07 Sep 2012 08:53:10 GMT</pubDate><dc:creator>Cliff Jones</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]Richard Warr (9/7/2012)[/b][hr]I looked at the first option and was disappointed that the second one wasn't[quote]Collect $200 for parsing GO.[/quote][/quote]I wish I had thought of that when I was writing the question!FYI the format of the question was actual from some code I've been using recently to load some data for volume testing.  GO 18 get's you about half a million rows, GO 20 gets 2 mil +. :w00t:Everyone has been real positive on this question so far.  Keep your fingers crossed for me on part 2.</description><pubDate>Fri, 07 Sep 2012 08:48:07 GMT</pubDate><dc:creator>Kenneth.Fisher</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Lucky me...not fallen prey by the trap GO 5 :-DNice Question though..</description><pubDate>Fri, 07 Sep 2012 08:47:25 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]Richard Warr (9/7/2012)[/b][hr]I looked at the first option and was disappointed that the second one wasn't[quote]Collect $200 for parsing GO.[/quote][/quote]+1 :-DGood question. Made me stop and think before my first cup of coffee.</description><pubDate>Fri, 07 Sep 2012 07:26:35 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>I looked at the first option and was disappointed that the second one wasn't[quote]Collect $200 for parsing GO.[/quote]</description><pubDate>Fri, 07 Sep 2012 07:19:31 GMT</pubDate><dc:creator>Richard Warr</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Ugh, I've got to stop answering these questions first thing in the morning.Great question though!</description><pubDate>Fri, 07 Sep 2012 07:03:01 GMT</pubDate><dc:creator>sestell1</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]jeff.mason (9/7/2012)[/b][hr]What's really bad is understanding the question correctly and screwing up the loop counts because it is early in the morning.  I counted the 5 loops but forgot to include the first run and ended up with 16.  Once I saw it was wrong I recounted and hit my forehead with my palm.[/quote]+ 1 - 1 (palm to forehead) :-DThank you for the great question, too bad I couldn't end Friday with that point. I guess I should have learned my lesson by trying to answer QotD this early before caffeine.</description><pubDate>Fri, 07 Sep 2012 06:57:57 GMT</pubDate><dc:creator>Dana Medley</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>What's really bad is understanding the question correctly and screwing up the loop counts because it is early in the morning.  I counted the 5 loops but forgot to include the first run and ended up with 16.  Once I saw it was wrong I recounted and hit my forehead with my palm.</description><pubDate>Fri, 07 Sep 2012 06:15:35 GMT</pubDate><dc:creator>jeff.mason</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Easy but tricky</description><pubDate>Fri, 07 Sep 2012 04:30:33 GMT</pubDate><dc:creator>udayroy15</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Great question that shows a feature of the GO command that I only recently learned. Excellent!</description><pubDate>Fri, 07 Sep 2012 04:27:01 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]Michael Lysons (9/7/2012)[/b][hr][quote][b]DugyC (9/7/2012)[/b][hr]What a fun question, thanks.[/quote]Actually, yeah it was - well said :-)[/quote]+1</description><pubDate>Fri, 07 Sep 2012 03:32:55 GMT</pubDate><dc:creator>Raghavendra Mudugal</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Lesson learned: Don't answer until after the first cup of strong coffee...</description><pubDate>Fri, 07 Sep 2012 03:30:37 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]L' Eomot Inversé (9/7/2012)[/b][hr] 1*2*2*2*2*2 = 6[/quote]It does equal 6! At least, that's my excuse.</description><pubDate>Fri, 07 Sep 2012 03:21:55 GMT</pubDate><dc:creator>Gazareth</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]Michael Lysons (9/7/2012)[/b][hr]Then again, "Is GO x valid T-SQL?" would be a boring question.:-)[/quote]And the answer is surprisingly: no.GO is not a TSQL statement, but a batch terminator recognised by sqlcmd, osql and SSMS.[url=http://msdn.microsoft.com/en-us/library/ms188037.aspx]GO (Transact-SQL)[/url]</description><pubDate>Fri, 07 Sep 2012 03:21:32 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]DugyC (9/7/2012)[/b][hr]What a fun question, thanks.[/quote]Actually, yeah it was - well said :-)</description><pubDate>Fri, 07 Sep 2012 03:12:09 GMT</pubDate><dc:creator>Michael Lysons</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>What a fun question, thanks.</description><pubDate>Fri, 07 Sep 2012 03:10:56 GMT</pubDate><dc:creator>DugyC</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Nice question.I can see both sides of the discussion above re. whether it was "worthless" or not. I do think the head-scratching (for me, at least) over how many records would be in the table takes away from whether "GO x" is valid or not.Then again, "Is GO x valid T-SQL?" would be a boring question.:-)</description><pubDate>Fri, 07 Sep 2012 03:10:56 GMT</pubDate><dc:creator>Michael Lysons</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Good questionNearly missed the 5 after the last go - then had to remember why it was significantGot my point though</description><pubDate>Fri, 07 Sep 2012 02:39:58 GMT</pubDate><dc:creator>Stuart Davies</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]L' Eomot Inversé (9/7/2012)[/b][hr]Good question.Two days in a row now answering early morning has proved that I shouldn't do it.  Yesterday I couldn't add.  Today I can't multiply (or at least I get 1*2*2*2*2*2 = 6). Evidently my brain doesn't start functioning until it has been fed and watered. :doze:[/quote]Edit: I've just noticed a failure to normalise even to 1 NF in my comment.  Two days in a row is clearly a repeating group.  :rolleyes:</description><pubDate>Fri, 07 Sep 2012 01:49:20 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Good question.Two days in a row now answering early morning has proved that I shouldn't do it.  Yesterday I couldn't add.  Today I can't multiply (or at least I get 1*2*2*2*2*2 = 6). Evidently my brain doesn't start functioning until it has been fed and watered. :doze:</description><pubDate>Fri, 07 Sep 2012 01:47:38 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Good question, thanks, and how annoying that I couldn't spot the twist until it was too late.Lesson:  Never answer QOTW before 7am.</description><pubDate>Fri, 07 Sep 2012 00:41:19 GMT</pubDate><dc:creator>derek.colley</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>[quote][b]tommyh (9/6/2012)[/b][hr]Worthless question because of the fact that you add something that doesnt really relate to the question. The key part in the question is the "GO 5" part. And by adding the select from the table in the insert you make the "GO 5" part secondary. /T[/quote]Why does it make GO 5 secondary?The GO 5 combined with the SELECT makes the insert a power of two, which is a nice twist on the question. The question still deals with the subject: a batch is repeated 5 times because it's followed by GO 5.@Kenneth: very nice question to end the week.</description><pubDate>Thu, 06 Sep 2012 23:34:30 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Worthless question because of the fact that you add something that doesnt really relate to the question. The key part in the question is the "GO 5" part. And by adding the select from the table in the insert you make the "GO 5" part secondary. /T</description><pubDate>Thu, 06 Sep 2012 23:15:01 GMT</pubDate><dc:creator>tommyh</dc:creator></item><item><title>RE: GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Awesome. :) thank you Kenneth.1. it will insert 1 record - FROM INSERT INTO2. it will insert 1 record - But the count in table is 2 - from INSERT..SELECT3. Iteration1- Inserts 2 records - the count is 44. Iteration2- Inserts 4 records - the count is 85. Iteration3- Inserts 8 records - the count is 166. Iteration4- Inserts 16 records - the count is 32AND7. Iteration5- Inserts 32 records - the count is 64Now this is where I went wrong, actually the #2's GO is the valid first iteration, so it stops at #6 which actually completes 5 iterations. (#7 is not valid)(so simple and yet I messed up :w00t:)(Just wanted to say Thank you to all, this is been the best learning experience apart from the regular routine :-))</description><pubDate>Thu, 06 Sep 2012 23:14:02 GMT</pubDate><dc:creator>Raghavendra Mudugal</dc:creator></item><item><title>GO Part 1</title><link>http://www.sqlservercentral.com/Forums/Topic1355723-1186-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/93260/"&gt;GO Part 1&lt;/A&gt;[/B]</description><pubDate>Thu, 06 Sep 2012 22:38:01 GMT</pubDate><dc:creator>Kenneth.Fisher</dc:creator></item></channel></rss>