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 ««12

set ansi_nulls Expand / Collapse
Author
Message
Posted Wednesday, June 2, 2010 7:39 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: Friday, July 18, 2014 6:18 AM
Points: 846, Visits: 849
david.wright-948385 (6/2/2010)
Absolutely right - my bad. I'm afraid my brain is wired to never ever use '=' or '<>' where either side can be null, even if I'm trying to make a point about exactly that

The really funny thing is, as I'm re-reading the question several times trying to find the "gotcha," I thought to myself, "You know, I'll bet the author meant for one of these to say '= NULL' and goofed up."


-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #931337
Posted Wednesday, June 2, 2010 8:56 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 28, 2014 1:04 PM
Points: 1,313, Visits: 1,055
Your finger muscle memory wouldn't allow you to write null=null! FWIW, I think the error helps emphasize the point about being careful when dealing with nulls.
Post #931421
Posted Wednesday, June 2, 2010 11:05 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 9:41 AM
Points: 2,818, Visits: 2,552
I read this carefully and thought to myself, "gee, why didn't the author use = Null, that would have been a better question." I answered the question, and read the forum responses....and lo and behold it was supposed to be = Null. Usually this is the sort of thing I will get wrong because I frequently read intent into the question and answer according to intent.
Post #931517
Posted Wednesday, June 2, 2010 1:59 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:46 PM
Points: 21,187, Visits: 14,880
Thanks for the nice question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #931657
Posted Thursday, June 3, 2010 5:06 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 24, 2013 9:59 PM
Points: 1,354, Visits: 1,299
I too got it right but for the wrong reason. I knew that using Null is Null will always be true (regardless of the setting of ANSI_NULLS) so that's why I got the right answer not because of what the ANSI_NULLS setting was during the creation of the stored procedure. I learned something today and glad I guessed correctly.
Post #931991
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse