Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


GO


Author
Message
Danny Ocean
Danny Ocean
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1432 Visits: 1549
Comments posted to this topic are about the item GO

Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com
WayneS
WayneS
SSCertifiable
SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)

Group: General Forum Members
Points: 6893 Visits: 10430
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, 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

WayneS
WayneS
SSCertifiable
SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)SSCertifiable (6.9K reputation)

Group: General Forum Members
Points: 6893 Visits: 10430
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, 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

M&M
M&M
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2783 Visits: 3900
I got this output, I am not sure about the options given.

Beginning execution loop
Batch execution completed 50 times.


M&M
honza.mf
honza.mf
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1787 Visits: 1323
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
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6265 Visits: 7188
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”
Iggy-SQL
Iggy-SQL
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2977 Visits: 440
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
forsqlserver
forsqlserver
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1408 Visits: 2048
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
paul.knibbs
paul.knibbs
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2098 Visits: 6222
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!
DugyC
DugyC
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1342 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 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 difficult tasks we do immediately, the impossible takes a little longer"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search