August 14, 2012 at 7:34 am
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?
(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 14, 2012 at 7:35 am
Jan.Sundbye (8/14/2012)
Good one. Once again I fell right into the trap. Must remember to RTFQ / RTFS (Read the **** Question / Statement)
Jan,
I was trying to not have a "trap". What about this question do you consider to have been a trap? (I'm trying to get better at writing these QotD's).
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 14, 2012 at 7:37 am
Dana Medley (8/14/2012)
I almost fell prey to the wording of the question, but after reading it twice I realized my original answers were incorrect. Thank you for the great question.
Dana,
I'm curious about the "I almost fell prey to the wording of the question" - what was there in this question that got you feeling this way? (I'm trying to get better at writing these QotD's).
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 14, 2012 at 7:43 am
Nice question!
August 14, 2012 at 7:48 am
WayneS (8/14/2012)
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Hi Wayne,
I see nothing wrong with this question. As long as you take the time to read the entire question, I fail to see how one could misunderstand it.
Maybe people who misread the question were only flying over the text and making assumptions on what the question is?
August 14, 2012 at 8:11 am
Hugo Kornelis (8/14/2012)
WayneS (8/14/2012)
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Hi Wayne,
I see nothing wrong with this question. As long as you take the time to read the entire question, I fail to see how one could misunderstand it.
Maybe people who misread the question were only flying over the text and making assumptions on what the question is?
That is exactly what I was aiming for. Thanks Hugo
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 14, 2012 at 8:11 am
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?
(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Wayne
Might I suggest that it would have been clearer for myself, and maybe for others, if the wording was:
"How many of these values will be inserted as a 1 into the BitVal column ?"
August 14, 2012 at 8:40 am
Hugo Kornelis (8/14/2012)
WayneS (8/14/2012)
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Hi Wayne,
I see nothing wrong with this question. As long as you take the time to read the entire question, I fail to see how one could misunderstand it.
Maybe people who misread the question were only flying over the text and making assumptions on what the question is?
+1
Definitely nothing wrong, no trick, no ambiguity, and absolutely straightforward wording.
Tom
August 14, 2012 at 8:55 am
I have to agree that this was a great question and don't see how it could be interpreted any other way. I think the "trap" may have been people knowing how the bit data type behaves in SQL Server and reading only what they wanted to read in the question. I'll admit, I saw it was a bit data type then read "which of the following values will be inserted" and almost went directly to answering without finishing the question since I was familiar with bit conversions. Fortunately I stopped myself, read the ENTIRE question, then answered.
August 14, 2012 at 9:06 am
Easy question as I had to face it in my programming some time ago!
Thanks!
August 14, 2012 at 9:06 am
L' Eomot Inversé (8/14/2012)
Hugo Kornelis (8/14/2012)
WayneS (8/14/2012)
One of the things that I'm trying to learn is to write better QotD questions. It looks like most that have responded here about missing it have acknowledged not reading the question carefully. So, how could this question have been written better?(The only thing that I can think of is to have bolded the "as a true / 1 value".)
Hi Wayne,
I see nothing wrong with this question. As long as you take the time to read the entire question, I fail to see how one could misunderstand it.
Maybe people who misread the question were only flying over the text and making assumptions on what the question is?
+1
Definitely nothing wrong, no trick, no ambiguity, and absolutely straightforward wording.
I also agree there is nothing wrong with it. We must read and analyze the question.
Great question, Wayne!!
August 14, 2012 at 10:06 am
Good job Wayne - good question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 14, 2012 at 10:49 am
Thomas Abraham (8/14/2012)
Excellent question. I particularly like questions, like this one, that highlight areas where the behavior is not as one might think, or is different than you might find in other languages. These are the gotchas that you have to know. Thanks!
Agreed. SQL syntax is essentially old C syntax - 0 is false, nonzero is true.
August 14, 2012 at 12:28 pm
in correct answer -1,1 is correct
but how 25 is correct
means to say... in bit datatype how we can store 25 (2 digit) value
??????
August 14, 2012 at 12:40 pm
buntyteg (8/14/2012)
means to say... in bit datatype how we can store 25 (2 digit) value
No. Any value other than 0 is converted to 1. So 1 is stored as given, and both -1 and 25 are converted to 1. (Which, by some tools, is interpreted and shown as true).
Viewing 15 posts - 16 through 30 (of 34 total)
You must be logged in to reply to this topic. Login to reply