--检测不符合整型的数据: select sz from bd_sbsxbjg where isnumeric(sjlx)=0 or sjlx like '%.%' --检测不符合浮点型的数据: select sz from bd_sbsxbjg where isnumeric(sjlx)=0
--检测是整型的数据: select sz from bd_sbsxbjg where isnumeric(sjlx)=1 and charindex('.',sjlx)=0 --检测是浮点型的数据: select sz from bd_sbsxbjg where isnumeric(sjlx)=1 and sjlx like '%.%'
CHARINDEX ( '.' , '要查数字段')
select sz from bd_sbsxbjg where isnumeric(sjlx)=0 or sjlx like '%.%'
--检测不符合浮点型的数据:
select sz from bd_sbsxbjg where isnumeric(sjlx)=0
select sz from bd_sbsxbjg where isnumeric(sjlx)=1 and charindex('.',sjlx)=0
--检测是浮点型的数据:
select sz from bd_sbsxbjg where isnumeric(sjlx)=1 and sjlx like '%.%'