Create FUNCTION [dbo].[CheckIsInt](@String nvarchar(255))
RETURNS bit
AS
BEGIN
Declare @Count int,@char nchar(1),@result bit
SET @Count=1
SET @result =0
While (@Count<=len(@String))
BEGIN
Set @char =substring(@String,@Count,1)
if(charindex(@char,'0123456789')=0)
return 0
else
SET @result=1
SET @Count =@Count + 1
END
return @result
END
No comments:
Post a Comment