This project is read-only.


fn_lpad (Transact_SQL)

See also: fn_rpad


This scalar UDF pads a given string to the left with specified character. Similar to Oracle's LPAD function. 
 

Syntax

fn_lpad(@string_to_pad,@pad_char,@pad_to_len) 

 

Arguments

@string_to_pad = NVARCHAR(MAX) , string that will be padded with @pad_char;

@pad_char = NVARCHAR(4000), char/string used to pad the input string.

@pad_to_len = BIGINT, the final length of the result string after padding 

 

Return type

NVARCHAR(MAX)

Remarks

none

 

Permissions

Public

 

Dependencies

none

 

Examples

SELECT * FROM [Lib].[tsql].[fn_lpad]( 'mystring' , '*',20)

************mystring

Other

none

 

Last edited Aug 16, 2012 at 1:45 PM by adudau, version 1

Comments

No comments yet.