September 7, 2012 at 4:27 am
Great question that shows a feature of the GO command that I only recently learned. Excellent!
September 7, 2012 at 4:30 am
Easy but tricky
September 7, 2012 at 6:15 am
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.
September 7, 2012 at 6:57 am
jeff.mason (9/7/2012)
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.
+ 1
- 1 (palm to forehead) 😀
Thank 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.
September 7, 2012 at 7:03 am
Ugh, I've got to stop answering these questions first thing in the morning.
Great question though!
September 7, 2012 at 7:19 am
I looked at the first option and was disappointed that the second one wasn't
Collect $200 for parsing GO.
September 7, 2012 at 7:26 am
Richard Warr (9/7/2012)
I looked at the first option and was disappointed that the second one wasn'tCollect $200 for parsing GO.
+1 😀
Good question. Made me stop and think before my first cup of coffee.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 7, 2012 at 8:47 am
Lucky me...not fallen prey by the trap GO 5 😀
Nice Question though..
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
September 7, 2012 at 8:48 am
Richard Warr (9/7/2012)
I looked at the first option and was disappointed that the second one wasn'tCollect $200 for parsing GO.
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.
Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]
September 7, 2012 at 8:53 am
Good question. I always forget that you can do that.
September 7, 2012 at 8:58 am
September 7, 2012 at 9:20 am
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.
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
September 7, 2012 at 11:10 am
Thanks for the question.
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
September 7, 2012 at 11:53 am
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.
September 7, 2012 at 12:29 pm
Great question. But it was a good thing I'd had my coffee/tea before I tried answering....
Rob Schripsema
Propack, Inc.
Viewing 15 posts - 16 through 30 (of 39 total)
You must be logged in to reply to this topic. Login to reply