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

Question of the Day for 01 Mar 2007 Expand / Collapse
Author
Message
Posted Wednesday, July 29, 2009 3:17 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, December 18, 2014 4:11 AM
Points: 701, Visits: 356
This question is quite wrong. The SET key word can not be used by = (EqualTo operator). The correct syntax is:
SET ANSI_NULLS OFF
this is wrong:
SET ANSI_NULLS= OFF


Deepak Kumar Sharma
Post #761351
Posted Tuesday, March 23, 2010 3:54 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, March 3, 2011 11:52 PM
Points: 452, Visits: 7
In the answer for this question, "The expression "MyID = NULL" evaluates to Unknown rather than any true or false condition."
then y it is false... instead of unknown. can anyone pls answer this...
Post #887935
Posted Tuesday, March 23, 2010 9:28 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:56 PM
Points: 280, Visits: 140
peratchiselvi.m (3/23/2010)
In the answer for this question, "The expression "MyID = NULL" evaluates to Unknown rather than any true or false condition."
then y it is false... instead of unknown. can anyone pls answer this...


It isn't "false" it is "null" - but it will fail in a where clause or case statement because it's "not true"
Post #888232
Posted Wednesday, March 24, 2010 5:38 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, March 3, 2011 11:52 PM
Points: 452, Visits: 7
s. ssc went wrong there then.... thank u...
Post #888831
Posted Wednesday, March 24, 2010 10:07 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:56 PM
Points: 280, Visits: 140
peratchiselvi.m (3/24/2010)
s. ssc went wrong there then.... thank u...


No not really, it's a kind of a trick question... when you use the = operator and compare to null, the result is always unknown rather than true or false. The proper expression is "IS NULL" which will evaluate to true or false rather than unknown. That's what the question was about.
Post #889095
Posted Wednesday, March 24, 2010 9:59 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, March 3, 2011 11:52 PM
Points: 452, Visits: 7
ok. ok. got it....thanks.
Post #889519
Posted Tuesday, April 20, 2010 3:42 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:21 PM
Points: 7,928, Visits: 9,653
I read this question, decided it was a bit weird because where clauses don't evaluate to anything and concluded that it must be asking what truth-value/values the expression in the where clause evaluates to and ansered accordingly (UNKNOWN). The answer given as correct is FALSE. The explanation simply says that the contained expression always evaluates UNKNOWN, and doen't make any suggestion of how FALSE comes from here. I guess the author has invented a new terminology: in this new terminology a filter evaluates to something instead of including or excluding a row, and "evaluates to false" means "excludes the current row". That's not very useful, as the existing terminology makes perfect sense.



Tom
Post #907310
Posted Tuesday, November 27, 2012 5:21 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, December 14, 2014 11:09 PM
Points: 1,962, Visits: 2,406
easy one for NULL


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1389116
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse