SQL IsNumeric not working

前端 未结 11 801
迷失自我
迷失自我 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:02

    I am also facing this issue and I solved by below method. I am sharing this because it may helpful to some one.

    declare @g varchar (50)
     set @g=char(10)
     select isnumeric(@g),@g, isnumeric(replace(replace(@g,char(13),char(10)),char(10),''))
    

提交回复
热议问题