sql 函数的创建
create function dbo.GetNumber(@Num varchar(32))
returns varchar(32)
as
begin
declare @i int
while patindex('%[a-Z]%',@Num) > 0
begin
set @i = patindex('%[a-Z]%',@Num)
set @Num = stuff(@Num,@i,1,'')
end
set @Num = replace(@Num,' ','')
return @Num
end
Create Function GetAllPY(@chn nvarchar(100))
returns varchar(30)
as
begin
2.
declare @i int,@j int,@result varchar(100)
set @result=''
set @i=len(@chn)
set @j=1
while @j<=@i
begin
set @result = @result + dbo.RmGetPY(substring(@chn,@j,1))
set @j=@j+1
end
return @result
end
isnumeric判断是否是数字
把学习一种技术一直坚持下去。