• crussell-931424 (11/24/2009)


    Any number of zeros returns 1. So if it is smart enough to know that all the characters are zero and thus must be a number why can't it just check all the characters individually to see if they are 0 to 9? Or is there no such thing as a number larger than a float's maximum value? I just now noticed that it strips away all leading zeros. I guess that answers my own question.

    SELECT ISNUMERIC(REPLICATE('0', 7690) + REPLICATE('1', 310)) returns 0

    SELECT ISNUMERIC(REPLICATE('0', 7691) + REPLICATE('1', 310)) returns 1

    The reason then that the second one returns 1 is that there are really only 309 of them. It only considers the first 8000 characters of the string, meaning there are really only 309 of the digit 1, which we already know returns a 1.

    i agree 0= 000 but 1 <> 111