SQL IsNumeric not working

前端 未结 11 898
迷失自我
迷失自我 2021-01-02 19:47

The reserve column is a varchar, to perform sums on it I want to cast it to a deciaml. But the SQL below gives me an error

select
cast(Reserve as decimal)
fr         


        
11条回答
  •  醉话见心
    2021-01-02 20:10

    IsNumeric is possibly not ideal in your scenario as from the highlighted Note on this MSDN page it says "ISNUMERIC returns 1 for some characters that are not numbers, such as plus (+), minus (-), and valid currency symbols such as the dollar sign ($)."

    Also there is a nice article here which further discusses ISNUMERIC.

提交回复
热议问题