IsNumeric checks

  • Below statement returns 1. Spend a lot of time zoning in on the data that was causing the issue

    Is this a MS SQL server bug?

    select Isnumeric('0.d00')

  • Not a bug.

    Isnumeric returns true if the value passed can be converted to any of the data types.

    select CAST('0.d00' as float)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the reply.

    Iam trying to cast as decimal because i need the decimal precision for the data that will be used later in my logic.

    select CAST('1.d20' as decimal(10,3))

    Above statement fails.

    What is the workaround? any ideas?

  • Remove the 'd'? (Why's it there in the first place?)

    Cast to float then to decimal?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

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