• Toreador (7/6/2010)


    That doesn't explain why isnumeric('1 234') = 0, despite being in the standard format for any locale with a space as the thousands separator!

    What I mentioned in my post was related only to the trailing spaces behavior. In other words

    select cast('1234 ' as int);

    is fine because the trailing spaces are removed before cast kicks in, but

    select cast('1 234' as int);

    will never fly simply because it is not a valid way to represent the number in every locale (though it is valid in some of them).

    select

    isnumeric('1234 ') trailing_yep,

    isnumeric('1 234') middle_nope;

    returns

    trailing_yep middle_nope

    ------------ -----------

    1 0

    in the environment I use.

    Oleg