Earlier I blogged about Puzzle – ISNUMERIC and Unexpected Results – SQL in Sixty Seconds #076 and it is one of the most popular blog posts. Lots of people answered the question correctly.
In the blog post I had a video puzzle. You can watch the video over here.
Now the puzzle was what was the value which I had passed in the second select statement which was returning the value of the SELECT statement as 1. The answer is I have passed TAB in the ISNUMERIC function.
The reason given by many of you is that as an ASCII value of the TAB is 9, it is returning the 1 in the ISNUMERIC function. Well, I am personally not sure if that is the valid reason or not. I will let you all decide the answer for the same.
However, MSDN’s official documentation says – ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0. That explains that it works with more than one data type.
If any of the blog readers have more details about the same, would you please post it in a comment and I will update the blog post with reference.
Reference: Pinal Dave (https://blog.sqlauthority.com)