CREATE FUNCTION dbo.PadLeft
(@String varchar(100),
--Input string to be padded
@Length int,
--Length of final string
@PadChar char(1) --Padding character
) RETURNS varchar(100)
AS
BEGIN
WHILE LEN(@String + 'z') <= @Length
SET @String = @PadChar + @String
RETURN @String
END
GO
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment