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»»»

Expressions Expand / Collapse
Author
Message
Posted Thursday, August 08, 2013 2:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, April 10, 2014 1:38 AM
Points: 1,615, Visits: 446
Definitely learnt something new today! Was very confused at first but a great explanation too - makes it simple. - Thanks.
Post #1482184
Posted Thursday, August 08, 2013 2:44 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 @ 6:40 AM
Points: 3,683, Visits: 4,818
Need my first cup of coffee before answering
Good question, thanks...


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1482188
Posted Thursday, August 08, 2013 4:20 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 8:39 AM
Points: 913, Visits: 1,847
Dang It! Did it again. I did NOT get my coffee before answering the question. Thus, missed it again. Good question.
Post #1482206
Posted Thursday, August 08, 2013 4:21 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:32 PM
Points: 5,794, Visits: 8,006
Good question!

*kicks self* - I knew this, have been bitten by it before, and STILL managed to get it wrong. Obviously need to be bittenn a lot more before it finally sinks in enough that I don't forget about it anymore... ;)



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1482207
Posted Thursday, August 08, 2013 4:31 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 08, 2014 6:13 AM
Points: 1,694, Visits: 19,550
Nice question, definitely learned something new.

____________________________________________________

How to get the best help on a forum

http://www.sqlservercentral.com/articles/Best+Practices/61537

Never approach a goat from the front, a horse from the rear, or a fool from any direction.
Post #1482210
Posted Thursday, August 08, 2013 5:29 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 03, 2013 1:55 AM
Points: 298, Visits: 236
Only 18% of correct answers! Good question mate ...
Post #1482234
Posted Thursday, August 08, 2013 6:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Today @ 2:34 AM
Points: 21, Visits: 43
paul.knibbs (8/8/2013)
ok181ko (8/8/2013)
How about
newid() = '00000000-0000-0000-0000-000000000000'

The question is not correct. Answer is 0 (zero).


The question asked which of the answers were possible outputs of the statement. It never stated that *all* of the possible outputs were listed as answers. Plus, is it even possible for NEWID() to return a value that's all zeroes?


And You can prove that this can not be?
Post #1482257
Posted Thursday, August 08, 2013 6:29 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 11:43 AM
Points: 242, Visits: 433
ok181ko (8/8/2013)
paul.knibbs (8/8/2013)
ok181ko (8/8/2013)
How about
newid() = '00000000-0000-0000-0000-000000000000'

The question is not correct. Answer is 0 (zero).


The question asked which of the answers were possible outputs of the statement. It never stated that *all* of the possible outputs were listed as answers. Plus, is it even possible for NEWID() to return a value that's all zeroes?


And You can prove that this can not be?

I can prove that particular value to be irrelevant:

select checksum('00000000-0000-0000-0000-000000000000')
-1448389036

Of course, this does not mean that there isn't a value for newid that would provide a checksum of 0, only that the value you selected is not it.



Puto me cogitare, ergo puto me esse.
I think that I think, therefore I think that I am.
Post #1482266
Posted Thursday, August 08, 2013 6:42 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:32 PM
Points: 5,794, Visits: 8,006
srienstr (8/8/2013)
select checksum('00000000-0000-0000-0000-000000000000')
-1448389036

You're calculating the checksum of a value that just happens to loook remarkably like a uniqueidentifier value - but is just a plain old varchar.

select checksum(cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier) )

Result: 0
(on my system)



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1482283
Posted Thursday, August 08, 2013 6:42 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 511, Visits: 417
Excellent question, thanks!
Post #1482284
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse