SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


GO


Author
Message
Kwex
Kwex
Mr or Mrs. 500
Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)

Group: General Forum Members
Points: 501 Visits: 240
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.
Richard Warr
Richard Warr
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3354 Visits: 1991
Don't worry - you get a bonus point for complaining about it in here ;-)

_____________________________________________________________________
MCSA SQL Server 2012
honza.mf
honza.mf
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2583 Visits: 1323
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
Daniel Fountain
Daniel Fountain
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: 1425 Visits: 890
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
Rich Weissler
Rich Weissler
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2189 Visits: 954
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.
dmoldovan
dmoldovan
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1624 Visits: 1479
I agree with WayneS.
And I have one more question - why do you ask about "the output of this batch"? As far as I can see there are 3 batches, separated by "GO". Am I missing something?
DugyC
DugyC
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1700 Visits: 779
honza.mf (6/7/2011)
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).


Yeesh! Somethings got your cage rattled :-P

I think I've made it perfectly clear that I'm on your side as much as I agree with Wayne... and I never slated the original post or the question, just explaining my confusion. That is all.

Chill pill :-D

_____________________________________________________________________
"The difficult tasks we do immediately, the impossible takes a little longer"
Lawrence M. Meklemburg
Lawrence M. Meklemburg
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1049 Visits: 156
Just adding my two cents.

.02
GO

or maybe

GO .02
Mike Is Here
Mike Is Here
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: 1820 Visits: 513
I ran this on a 2005 box and got an insert error

Insert Error: Column name or number of supplied values does not match table definition.
** An error was encountered during execution of batch. Continuing.

Why was my result different from others
Mike Is Here
Mike Is Here
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: 1820 Visits: 513
Never Mind, I had another table test in the db, nice.
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