摘要:
create function dbo.t_bh (@str varchar(20))returns varchar(20)asbegindeclare @bh varchar(20),@length int,@i intset @length=12-LEN(@str) if LEN(@str)<12 begin set @i=0 while @i<@length begin set @str='0'+@str set @i=@i+1 end return @str end else if isnull(@str,0)=0 begin set @str='0 阅读全文