In SSIS, there is a REVERSE function to return the string column or character expression in reverse order. This article explains how to use the REVERSE function with an example and the syntax to perform string reverse is as shown below.
REVERSE(<<Character_expression>>)
To demonstrate the SSIS string REVERSE function, we use the Employee table below, which has 15 records. Please refer to the Union All Transformation, Derived Column Transformation, Built-in Functions, and SQL Server articles in SSIS.
SSIS String Reverse
For this REVERSE function, let me add a Data Flow Task and double-click on it to enter the Data Flow region. Next, add the OLE DB Source to read data from the above SQL database table. Please join the OLE DB Source to Derived Column Transformation because it helps to write REVERSE function expressions and create new columns.
Next, double-click on it to open the Derived Column Transformation Editor. Drag and drop the SSIS string REVERSE function to the row cell under the Expression and replace the Character_expression with the string column name (Name and Occupation). Either you can manually delete the complete <<character_expression>> expression or drag and drop the column will automatically replace it.
The below expressions will reverse the order of the characters in the name and Occupation columns.
REVERSE( [Name] )
REVERSE( [Occupation] )
Click OK to close the Editor window. Drag and drop the Union All Transformation and connect the Derived Column to it. Next, right-click on the connection node and choose the Enable Data Viewer.
Please run the SSIS string REVERSE package to see the string characters of the name and occupation in reverse order.