去掉一段字符串中前面为零的sql函数
create function [dbo].[RemoveStr](@InputStr varchar(50))
returns varchar(50)
AS
BEGIN
declare @BackStr varchar(50)
if patindex('%[^0]%',@InputStr) <> 1
begin
set @BackStr = substring(@InputStr,patindex('%[^0]%',@InputStr),len(@InputStr))
end
else
begin
set @BackStr = @InputStr
end
return @BackStr
END
GO