Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

GO Expand / Collapse
Author
Message
Posted Monday, June 06, 2011 8:04 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 06, 2014 4:15 AM
Points: 1,242, Visits: 1,546
Comments posted to this topic are about the item GO



Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

Post #1120712
Posted Monday, June 06, 2011 9:16 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:26 PM
Points: 6,546, Visits: 8,770
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
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, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1120717
Posted Monday, June 06, 2011 9:21 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:26 PM
Points: 6,546, Visits: 8,770
Whoops... quoted my post instead of editing it. It's now corrected...

Wayne
Microsoft Certified Master: SQL Server 2008
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, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1120718
Posted Monday, June 06, 2011 10:28 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, April 14, 2014 5:49 PM
Points: 2,263, Visits: 3,758
I got this output, I am not sure about the options given.

Beginning execution loop
Batch execution completed 50 times.


Mohammed Moinudheen
Post #1120729
Posted Tuesday, June 07, 2011 12:07 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 17, 2014 11:47 PM
Points: 1,298, Visits: 1,306
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
The "correct" answer is least non-correct.




See, understand, learn, try, use efficient
© Dr.Plch
Post #1120749
Posted Tuesday, June 07, 2011 1:13 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 3,694, Visits: 4,828
Good question, just the options are not related.
I concur with Wayne.
However, I suspect the final command ought to have been:
SELECT COUNT(*) FROM Test

which would have rendered a result comparable with the options availalbe.


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1120766
Posted Tuesday, June 07, 2011 1:26 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 5:31 PM
Points: 2,953, Visits: 435
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
Post #1120770
Posted Tuesday, June 07, 2011 2:10 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:34 AM
Points: 1,199, Visits: 1,899
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

Post #1120785
Posted Tuesday, June 07, 2011 2:37 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:26 AM
Points: 1,529, Visits: 5,190
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!
Post #1120797
Posted Tuesday, June 07, 2011 3:34 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 4:28 AM
Points: 1,248, Visits: 779
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
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 difficult tasks we do immediately, the impossible takes a little longer"
Post #1120826
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse