Export (0) Print
Expand All

LTRIM (SSIS Expressions)

Returns a character expression after removing leading spaces.

NoteNote

LTRIM does not remove white-space characters such as the tab or line feed characters. Unicode provides code points for many different types of spaces, but this function recognizes only the Unicode code point 0x0020. When double-byte character set (DBCS) strings are converted to Unicode they may include space characters other than 0x0020 and the function cannot remove such spaces. To remove all kinds of spaces, you can use the Microsoft Visual Basic .NET LTrim method in a script run from the Script component.


LTRIM(character expression)

character_expression

Is a character expression from which to remove spaces.

DT_WSTR

LTRIM works only with the DT_WSTR data type. A character_expression argument that is a string literal or a data column with the DT_STR data type is implicitly cast to the DT_WSTR data type before LTRIM performs its operation. Other data types must be explicitly cast to the DT_WSTR data type. For more information, see Integration Services Data Types and Cast (SSIS Expressions).

LTRIM returns a null result if the argument is null.

This example removes leading spaces from a string literal. The return result is "Hello".

LTRIM("    Hello")

This example removes leading spaces from the FirstName column.

LTRIM(FirstName)

This example removes leading spaces from the FirstName variable.

LTRIM(@FirstName)

Community Additions

ADD
Show:
© 2014 Microsoft