GO Part 1

  • Great question that shows a feature of the GO command that I only recently learned. Excellent!

  • Easy but tricky

  • 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.

  • 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.



    Everything is awesome!

  • Ugh, I've got to stop answering these questions first thing in the morning.

    Great question though!

  • I looked at the first option and was disappointed that the second one wasn't

    Collect $200 for parsing GO.

  • Richard Warr (9/7/2012)


    I looked at the first option and was disappointed that the second one wasn't

    Collect $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/

  • Lucky me...not fallen prey by the trap GO 5 😀

    Nice Question though..

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Richard Warr (9/7/2012)


    I looked at the first option and was disappointed that the second one wasn't

    Collect $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]

  • Good question. I always forget that you can do that.

  • Excellent question, Kenneth.

    Almost caught by the 5, thinking it selected 1 row on every iteration.

    Keep these kind of questions comin'!!

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • 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

  • 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

  • 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.

  • 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