T-sql - determine if value is integer

后端 未结 20 2206
情深已故
情深已故 2020-11-30 12:11

I want to determine if a value is integer (like TryParse in .NET). Unfortunatelly ISNUMERIC does not fit me because I want to parse only integers a

20条回答
  •  醉话见心
    2020-11-30 12:50

    This work around with IsNumeric function will work:

    select * from A where ISNUMERIC(x) =1 and X not like '%.%'

    or Use

    select * from A where x **not like** '%[^0-9]%'

提交回复
热议问题