标签:ati fun tin creat dex 系统 cti null arc
主要是在sql server的内置系统函数ISNUMERIC的基础上,将例外的“+”、“-”、“$”等进行也进行判断。
CREATE FUNCTION [dbo].[fn_IsNumberic]
(
@str nvarchar(max)
)
RETURNS int
AS
BEGIN
declare @res int
set @res=case when ISNUMERIC(isnull(@str,0))=1 then
case when PATINDEX(‘%[^0-9.]%‘,rtrim(ltrim(isnull(@str,0))))=0 then 1
end
end
return isnull(@res,0)
END
GO
标签:ati fun tin creat dex 系统 cti null arc
原文地址:http://www.cnblogs.com/jearay/p/7827336.html