--取: select * from tablename where isnumeric(columnname) = 1--删: delete from tablename where isnumeric(columnname) = 0
--取: select * from tablename where isnumeric(columnname) = 1 and charindex('.',columnname) = 0--删: delete from tablename where isnumeric(columnname) = 0 and charindex('.',columnname) > 0
--删: delete from tablename where isnumeric(columnname) = 0 or columnname like '%.%' --or
确定表达式是否为一个有效的数字类型。
select * from tablename where isnumeric(columnname) = 1--删:
delete from tablename where isnumeric(columnname) = 0
select * from tablename where isnumeric(columnname) = 1 and charindex('.',columnname) = 0--删:
delete from tablename where isnumeric(columnname) = 0 and charindex('.',columnname) > 0
delete from tablename where isnumeric(columnname) = 0 or columnname like '%.%' --or
数字:isnumeric(字段)=1
----------------------------------------------------
SELECT PATINDEX('%[^0-9]%','123')
, PATINDEX('%[^0-9]%','123.25')
, PATINDEX('%[^0-9]%','12AB3')
----------- ----------- -----------
0 4 3(1 row(s) affected)返回值大于零的都表示含有非0-9的字符。