GO

  • Comments posted to this topic are about the item GO

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Actually, none of those choices are correct. You get back 50 random GUID values.

    1. NEWID() returns a random GUID (aka uniqueidentifier)

    2. Select statement has no order by clause, so the results are random.

    3. The GO 50 repeats that batch 50 times (if in SSMS and the batch separator is set to "GO")

    The answer annotated as correct ("50") is not correct... the results are 50 random GUID values. "50" is not returned. Now, if it was a select count(*), that would be different.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Whoops... quoted my post instead of editing it. It's now corrected...

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • I got this output, I am not sure about the options given.

    Beginning execution loop

    Batch execution completed 50 times.

    M&M

  • WayneS (6/6/2011)


    Actually, none of those choices are correct. You get back 50 random GUID values.

    1. NEWID() returns a random GUID (aka uniqueidentifier)

    2. Select statement has no order by clause, so the results are random.

    3. The GO 50 repeats that batch (since the last GO statement) 50 times (if in SSMS and the batch separator is set to "GO")

    The answer annotated as correct ("50") is not correct... the results are 50 random GUID values. "50" is not returned. Now, if it was a select count(*), that would be different.

    Is it so hard to add the missing count? Be empathic a little :w00t:

    The "correct" answer is least non-correct.



    See, understand, learn, try, use efficient
    © Dr.Plch

  • This was removed by the editor as SPAM

  • I got it right, but I just wonder, if GO is meant to take an optional [count], why does it has the red squiggly underline mark when writing it in SSMS as a query, stating that there's an Incorrect syntax near '50'.?


    Urbis, an urban transformation company

  • I am getting output:

    7B6A0544-E2A0-4984-921E-BE50EED041C7

    8BF68496-1DC4-4C47-850E-7000FAA8FF23

    D0662128-5ED0-4002-ADED-149176F78CF0

    C031E61D-F269-4396-B435-B4C0A27A0E2B

    0062D0A0-9D78-49AB-92FB-74C6E3897E4A

    3B140F69-EC2C-4408-B964-05191269CC7F

    D36C7A52-B12F-491D-B8FB-CEC66AF882AA

    1641F77F-773D-4D5B-A6C6-A9093F8B5407

    9DA5ACE7-CA20-4F77-9FB6-85CDC1FDFE90

    0D8A7C99-635B-486A-B474-9B0BF0811DA1

    7D6D3E60-5F37-4661-9A11-08CF7F945E5C

    9688954C-257C-43D3-B1EA-5B3A8882EC95

    63D295CB-CC97-4CAE-9AF9-C1CF29DB32FE

    2B010BF8-0BD2-4DBB-AE8E-DCBDA5B244A0

    27E2ECFF-D583-44C8-A52F-D88ADE519CC9

    EF1D1257-BE9E-4986-8D63-E8E448415492

    A7CDECB7-B027-4FB3-B043-31AFCC9B052E

    F93C4582-CA31-4A66-BEE9-35EAD97E5E19

    913A51F6-5EF9-42F8-AB40-D5AB3E61B6AD

    E552812C-A5EE-4822-B8FF-024FC8D5F98D

    A1504FFA-C745-425F-9DBA-393539BB7B96

    07EA24AF-3883-4683-AE4F-358417136322

    E066CA84-C9BA-4092-8C77-FDA77CAECB33

    2BBEEDB7-6FB3-4E2B-9F8D-17CD99D6ADD1

    42C91981-440F-498F-B086-A93F94012B31

    DE471573-2472-47F8-B988-494A0F5CB7CF

    43A7C0AA-9D28-462C-A72E-BF99DE3D5F88

    3973D9ED-13F1-49B9-A536-16D6BF492B9F

    B8F6BCBD-BD1C-48AA-8245-29C81091355F

    D14DC363-E7A0-4F8C-9B70-F61973F432DB

    E0A22C1A-08EF-4984-8103-DBC1EA15D169

    363ABE39-C885-4451-84D1-A3D139CCE011

    A8D29B94-1173-437A-A57A-14D590C60E81

    13FCC563-FECE-444C-A3AD-55B06E272D51

    9E4CF011-707E-45AB-819C-7C9BD78DB1D9

    5E5B12E5-E138-40D8-90FC-0F6B34C7A2DF

    1FCD9199-406B-4D95-AC1C-EBDEA0D8169A

    01BEB968-C602-431C-AB64-A02F954EA6D2

    3DD7B2E0-7CD5-4BDA-9767-C52C4EFB9A48

    BD7B20A8-7CFB-4C3C-9410-91BCEEAFB156

    F58DE698-589C-44A5-875D-F00EDE2D54F0

    7F777827-BC44-4E5F-A250-1E3C4796A9C1

    11DB94A8-FF2E-48DC-82A8-527959235BE8

    5247A89D-2E11-4AEA-9E23-3D98320663CA

    8F3F76FF-AC4E-4D97-9332-D9F993A95E5E

    BC0058CF-C95D-4875-82E4-F98F1CC0FE8E

    90865093-3793-4012-80E9-5EEF06F8F117

    E4278787-C7EB-44AE-90C7-35B718F7A981

    08862B48-A0D2-46F4-A300-ABD1E8AE94CA

    B0BD7A3A-11D8-494C-9E7F-A8AEB706CF7D

    Thanks

  • I agree with Wayne--I selected "50" because it was the least incorrect of the provided options, but the question (or the answers) could definitely have been clearer!

  • honza.mf (6/7/2011)


    WayneS (6/6/2011)


    Actually, none of those choices are correct. You get back 50 random GUID values.

    1. NEWID() returns a random GUID (aka uniqueidentifier)

    2. Select statement has no order by clause, so the results are random.

    3. The GO 50 repeats that batch (since the last GO statement) 50 times (if in SSMS and the batch separator is set to "GO")

    The answer annotated as correct ("50") is not correct... the results are 50 random GUID values. "50" is not returned. Now, if it was a select count(*), that would be different.

    Is it so hard to add the missing count? Be empathic a little :w00t:

    The "correct" answer is least non-correct.

    I concur with Wayne, I eliminated your "least non-correct" answers as I knew, had the batch worked, it would return a list of guids... therefore I went for an error condition and got it wrong.

    Normally I would agree with you regarding being "picky", but here the ambiguity was too deep.

    _____________________________________________________________________
    [font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]

  • I almost missed this because of the incorrect options available. Went with the least "non-correct" answer as done by other members. I think this question should be a bonus for those that missed it because of incorrect options given.

    Kwex.

  • Don't worry - you get a bonus point for complaining about it in here 😉

  • DugyC (6/7/2011)


    honza.mf (6/7/2011)


    WayneS (6/6/2011)


    Actually, none of those choices are correct. You get back 50 random GUID values.

    1. NEWID() returns a random GUID (aka uniqueidentifier)

    2. Select statement has no order by clause, so the results are random.

    3. The GO 50 repeats that batch (since the last GO statement) 50 times (if in SSMS and the batch separator is set to "GO")

    The answer annotated as correct ("50") is not correct... the results are 50 random GUID values. "50" is not returned. Now, if it was a select count(*), that would be different.

    Is it so hard to add the missing count? Be empathic a little :w00t:

    The "correct" answer is least non-correct.

    I concur with Wayne, I eliminated your "least non-correct" answers as I knew, had the batch worked, it would return a list of guids... therefore I went for an error condition and got it wrong.

    Normally I would agree with you regarding being "picky", but here the ambiguity was too deep.

    The list of GUIDs was not in the list of possible answers.

    If you don't like to add count to the last query, just imagine some words like "GUIDs", "lines", or "items" after the numeric possibilities. And the answer is almost correct.

    Other idea: Try to write your own QotD (I did) and make it bulletproof (first time I was far away of that).



    See, understand, learn, try, use efficient
    © Dr.Plch

  • I got that wrong due to the question being very vague.

    However i do note that it must be hard to do this on a daily basis and get them perfect 100% of the time.

    So on that note - i just want to say thanks to those who write questions for QotD

    Dan

  • paul.knibbs (6/7/2011)


    I agree with Wayne--I selected "50" because it was the least incorrect of the provided options, but the question (or the answers) could definitely have been clearer!

    I did this too, figuring it would be the best way to get over to the forum to see if other folks had the same issue with the question. 🙂 I suppose it's a test of my telepathic ability to determine what was intended.

Viewing 15 posts - 1 through 15 (of 54 total)

You must be logged in to reply to this topic. Login to reply