# Trim Functions in SSIS


In T-SQL there are many functions there to help do a variety of different things.  SSIS is no different.  In fact, a good number of the commonly used functions from T-SQL are in SSIS as well.  Here we will explore the different Trim functions found in SSIS. We will be using the test phrase "      Test      " to illustrate the three functions: LTRIM, RTRIM and TRIM. **LTRIM (Left Trim):** Just as in T-SQL, this removed empty spaces from the beginning (or left) of a string. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716523426983/8703eb30-bb0a-4092-a5ed-216f273f838f.png) Notice the highlighted result that the trailing spaces are still present but the leading spaces are gone. **RTRIM (Right Trim):** Just as in T-SQL, this removed empty spaces from the end (or right) of a string. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716523427809/a9db7556-7bd8-4e8e-b46a-56251233863a.png) Notice the highlighted result that the trailing spaces are gone but the leading spaces are still present. **TRIM:** In T-SQL to remove both leading and training spaces you have to nest the trim statements like this: SELECT LTRIM(RTRIM(ColumnName)) AS ColumnName FROM Table. Luckily in SSIS there is a TRIM function that will remove both leading and trailing space in one function called TRIM. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716523428792/a088ec6a-8b7f-4d8a-8fac-dce386c8a035.png) Notice the highlighted result that the trailing and leading spaces are gone.

