January 22, 2013 at 5:59 am
Good question but this real doesn't have to do with the data type bit but instead about reading double negatives
IF NOT EXISTS (SELECT 1 WHERE @BIT IS NOT NULL) SELECT 'Output 2'
@Bit could have been any non-null type
January 22, 2013 at 6:50 am
mbova407 (1/22/2013)
Good question but this real doesn't have to do with the data type bit but instead about reading double negatives
IF NOT EXISTS (SELECT 1 WHERE @BIT IS NOT NULL) SELECT 'Output 2'
@Bit could have been any non-null type
I have to agree... it was nice to get my brain started this morning though.... it's too cold in Chicago... I was having a hard time getting my thinking cap on because I don't want to take the wool one off.
January 22, 2013 at 7:05 am
Nice, easy logic question to get the day started!
January 22, 2013 at 7:26 am
Thanks for the question (and the point)
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
January 22, 2013 at 8:46 am
The question's IF statements challenged my logic processing more than the data type, but it still was a good question because I like logic puzzles - Thanks 🙂
January 22, 2013 at 12:18 pm
Excellent question. I speculate that Output 2 drew the most wrong answers due to its double-negative ("not exists ... is not null").
January 22, 2013 at 3:42 pm
January 22, 2013 at 4:32 pm
Nice, +1
Not all gray hairs are Dinosaurs!
January 23, 2013 at 10:46 pm
nice question..
+1 😛
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
January 24, 2013 at 5:10 am
Nice question, but the reference provided in the explanation doesn't cover the only interesting point here, which is whether the variable is null after assigning the string 'TRUE' to it; Lokesh Vij already posted the reference for that.
Of course the question could be answered with very little idea of what's going on, since either the variable was null (in which case there would be three outputs) or it wasn't (and there would be no output). Since thoption for three outputs wasn't avalaible, the right answer had to be no output - so just the ability to evaluate simple boolean expressions would be enough to answer the question. So it's rather surprising that 218 people (21%) managed to get it wrong.
Tom
January 25, 2013 at 12:07 pm
Nice, easy question.
January 26, 2013 at 3:26 am
It's nice a question.
February 3, 2013 at 1:05 pm
Nice brain tease figuring out the NOT EXISTS WHERE IS NOT NULL 🙂
But this is more of a general parameter null question, not just limited to the bit data type, correct?
February 4, 2013 at 2:23 pm
Easy One +1
February 22, 2013 at 1:50 am
easy even without running code
Viewing 15 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply