标签:
/* SELECT dbo.fn_PadLeft(‘8‘, ‘0‘, 6) */ create function fn_PadLeft(@num nvarchar(16),@paddingChar char(1),@totalWidth int) returns nvarchar(16) as begin declare @curStr nvarchar(16) select @curStr = isnull(replicate(@paddingChar,@totalWidth - len(isnull(@num ,0))), ‘‘) + @num return @curStr end
标签:
原文地址:http://www.cnblogs.com/zjflove/p/4600238.html