August 3, 2011 at 8:18 pm
Comments posted to this topic are about the item IsNumeric with NULL and Empty String
http://brittcluff.blogspot.com/
August 3, 2011 at 8:19 pm
August 3, 2011 at 9:36 pm
Whoo.Hooo..
2nd comment on this QOTD. Haven't been able to do that in quite a while. Thanks for the good question. I got it right as I just recently had to deal with a very similar problem about how ISNULL works.
Thanks again!!
August 3, 2011 at 11:52 pm
Data_God (8/3/2011)
Whoo.Hooo..2nd comment on this QOTD. Haven't been able to do that in quite a while. Thanks for the good question. I got it right as I just recently had to deal with a very similar problem about how ISNULL works.
Thanks again!!
I think it is about implicit conversion
Regards,
Iulian
August 3, 2011 at 11:52 pm
Thanks for the question
Regards,
Iulian
August 4, 2011 at 12:28 am
Great question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 4, 2011 at 1:05 am
DOH!
right answer, wrong reason.
I saw the int, an empty string, an implicit conversion and an ISNULL.
Went straight for the NO without reading the rest.
If anyone feels they have ever been robbed of a point they are welcome to mine today.
good question.
August 4, 2011 at 2:00 am
Nice, straight forward, implicit conversion question. Greast start to the day.
Cheers 😀
_____________________________________________________________________
[font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]
August 4, 2011 at 2:18 am
Nice question! I actually guessed on the basis of the first column returning a different result, not the second 🙂
August 4, 2011 at 2:25 am
Good question, thanks.
M&M
August 4, 2011 at 3:43 am
This was removed by the editor as SPAM
August 4, 2011 at 5:16 am
Looks like mostly good feedback. Glad most people have had a positive experience today.
http://brittcluff.blogspot.com/
August 4, 2011 at 5:48 am
Britt Cluff (8/4/2011)
Looks like mostly good feedback. Glad most people have had a positive experience today.
Wait for it. There will be someone that will hold a baby coyote in their left hand, a copy of a NYC subway map in their right, chant the names of the last 5 UN Secretary Generals, and manage to get a different result. 😉
None of which will change my appreciation for a great question. Thanks. Count me as a "got it right for wrong reason" today. Good to be reminded of simple things like implicit conversion. I usually catch it in my own code, but maintain lots of code written by unseen developers.
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
August 4, 2011 at 6:27 am
Nice fun question.
I imagine some people will get the right answer for the wrong reason, but at least they will not b emoaning about "I want my point". More people will get it right for the right reason. So perhaps the proportion of wrong answers will be rather smaller than usual.
One potential gripe though: the reference given in the explanation doesn't explain what IsNumeric returns for NULL - but no-one should complain about that, as it probably isn't documented in BoL.
I've always found it a bit disappointing that IsNumeric(Null) doesn't return NULL; after all, a NULL value doesn't contain any non-numeric characters, so it's not not numeric; and it doesn't contan any characters that are numeric, so it's not numeric either; so it should surely return NULL; just yet another case where (T-)SQL gets it wrong with NULL. But then IsNumeric is such an awful function anyway that that's teh least of its worries (perhaps the biggest is its name).
Tom
August 4, 2011 at 7:06 am
Implicit conversion is one of those issues, where if you know it, you just know. If you don't know it, the result is very unexpected. I am learning more and more of these, but I wonder, is there a singular document reference that lists all the implicit conversions that happen in SQL Server?
Viewing 15 posts - 1 through 15 (of 37 total)
You must be logged in to reply to this topic. Login to reply