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 Tuesday, June 7, 2011 3:48 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 3, 2013 1:55 AM
Points: 298, Visits: 236
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.
Post #1120831
Posted Tuesday, June 7, 2011 4:04 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 23, 2014 9:24 AM
Points: 2,174, Visits: 1,753
Don't worry - you get a bonus point for complaining about it in here
Post #1120834
Posted Tuesday, June 7, 2011 4:17 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 1:20 AM
Points: 1,393, Visits: 1,315
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
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
Post #1120842
Posted Tuesday, June 7, 2011 4:26 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:49 AM
Points: 769, Visits: 849
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
Post #1120851
Posted Tuesday, June 7, 2011 4:46 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 30, 2014 7:38 AM
Points: 1,823, Visits: 904
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.
Post #1120863
Posted Tuesday, June 7, 2011 4:53 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, October 20, 2014 2:24 AM
Points: 363, Visits: 1,324
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?
Post #1120865
Posted Tuesday, June 7, 2011 5:02 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)
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
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

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


_____________________________________________________________________
"The difficult tasks we do immediately, the impossible takes a little longer"
Post #1120870
Posted Tuesday, June 7, 2011 6:03 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 10:51 AM
Points: 1,005, Visits: 143
Just adding my two cents.

.02
GO

or maybe

GO .02
Post #1120912
Posted Tuesday, June 7, 2011 6:06 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 8:14 AM
Points: 1,393, Visits: 483
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
Post #1120914
Posted Tuesday, June 7, 2011 6:09 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 8:14 AM
Points: 1,393, Visits: 483
Never Mind, I had another table test in the db, nice.
Post #1120915
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse