|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 2:29 PM
Points: 3,367,
Visits: 1,575
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 8:49 AM
Points: 462,
Visits: 1,229
|
|
Awesome. :) thank you Kenneth.
1. it will insert 1 record - FROM INSERT INTO 2. it will insert 1 record - But the count in table is 2 - from INSERT..SELECT 3. Iteration1- Inserts 2 records - the count is 4 4. Iteration2- Inserts 4 records - the count is 8 5. Iteration3- Inserts 8 records - the count is 16 6. Iteration4- Inserts 16 records - the count is 32 AND 7. Iteration5- Inserts 32 records - the count is 64
Now 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 )
(Just wanted to say Thank you to all, this is been the best learning experience apart from the regular routine )
ww; Raghu -- There are only 10 types of people in the world, those who understand binary, and those who don't.
Note: (as of now) only.. 1 and 4 applies (i am on my way...)
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:15 AM
Points: 1,479,
Visits: 1,943
|
|
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
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 9,410,
Visits: 6,495
|
|
tommyh (9/6/2012) 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
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.
How to post forum questions. Need an answer? No, you need a question. What’s the deal with Excel & SSIS?
Member of LinkedIn. My blog at LessThanDot.
 MCSA SQL Server 2012 - MCSE Business Intelligence
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 3:41 AM
Points: 496,
Visits: 587
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:43 PM
Points: 7,182,
Visits: 7,280
|
|
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.
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
http://es.linkedin.com/in/tomthomsonsoftware
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:43 PM
Points: 7,182,
Visits: 7,280
|
|
L' Eomot Inversé (9/7/2012)
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. 
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.
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
http://es.linkedin.com/in/tomthomsonsoftware
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 1:11 PM
Points: 2,499,
Visits: 2,198
|
|
Good question
Nearly missed the 5 after the last go - then had to remember why it was significant
Got my point though
------------------------------- Posting Data Etiquette - Jeff Moden Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 4:05 AM
Points: 1,127,
Visits: 937
|
|
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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 1:19 AM
Points: 1,181,
Visits: 744
|
|
What a fun question, thanks.
_____________________________________________________________________ "The difficult tasks we do immediately, the impossible takes a little longer"
|
|
|
|