ISNUMERIC(varchar)

  • Comments posted to this topic are about the item ISNUMERIC(varchar)

  • Good question. Any one know why it returns 1 for some/most of special characters?

  • Two days in a row of easy questions. Didn't have to think long on this one! 🙂

    As for why many special characters show up as numeric, it has to do with how those characters are commonly used to represent numerical data. For a great explanation, see Jeff Moden's article on this: http://www.sqlservercentral.com/articles/IsNumeric/71512/"> http://www.sqlservercentral.com/articles/IsNumeric/71512/

  • I had to google my way for the answer. Nice question, learned something new. Don't know if I will be ever using it.

  • Why it returns 1 ?

  • T.Ashish (10/15/2013)


    Why it returns 1 ?

    ISNUMERIC returns 1 if the value could be interpreted as a number and 0 if it couldn't. The three examples in the QOTD gave 1 as they are a minus sign, dollar sign and a decimal point, so therefore could be part of a number (-0,$0,0.0). "This" could not be regarded as being a number, so would return 0.

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

  • Nice question..First thought 000..Then I read the question again .....Got it at last but took help....

  • This was removed by the editor as SPAM

  • Nice and interesting question.....

  • Stuart Davies (10/15/2013)


    T.Ashish (10/15/2013)


    Why it returns 1 ?

    ISNUMERIC returns 1 if the value could be interpreted as a number and 0 if it couldn't. The three examples in the QOTD gave 1 as they are a minus sign, dollar sign and a decimal point, so therefore could be part of a number (-0,$0,0.0). "This" could not be regarded as being a number, so would return 0.

    +1. I got it straightaway. There was one question posted regarding ISNUMERIC few days back and therefore had read on this topic. 🙂

  • Easy one! Thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • For me this is one of the big issues with 2008. As these will pass isnumeric but some of them (for instance ",") will then not convert into decimals floats etc. It would however i believe convert into money.

    In 2012 there is now Try_Convert which i am hoping will be much better for sorting this out.

    http://technet.microsoft.com/en-us/library/hh230993.aspx

  • ksatpute123 (10/14/2013)


    I had to google my way for the answer. Nice question, learned something new. Don't know if I will be ever using it.

    Nice question ....

  • Interesting.... Thanks!

    ---------------
    Mel. 😎

  • +1 to the good question, it forced me to research if the symbols could be labeled as "numbers".

    I am still trying to find it but I remember someone in forums suggested rewriting the function to remove such use cases.

Viewing 15 posts - 1 through 15 (of 33 total)

You must be logged in to reply to this topic. Login to reply