IsNumber fails cast while IsBigInt passes cast

  • Bill Talada

    SSChampion

    Points: 11955

    Comments posted to this topic are about the item IsNumber fails cast while IsBigInt passes cast

  • boris-1116387

    SSCommitted

    Points: 1941

    There is simpliest way to found non numeric symbols in string:

    .....

    if patindex('%[^0-9]%',@s)>0

    set @value=0

    ....

  • Nadrek

    SSCoach

    Points: 19979

    For character type strings you expect to be integers, there's also

    ISNUMERIC(RTRIM(@value) + '.0e0')

  • Bill Talada

    SSChampion

    Points: 11955

    I think everyone is totally missing the point that the IsNumeric function succeeds on junk that will fail when you later do a cast. Do your suggestions handle the strange cases in the comments at the top of my IsBigInt function?

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the interesting script.

Viewing 5 posts - 1 through 5 (of 5 total)

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