The SSIS SIGN function is a mathematical function that will check and return the sign of the specified number or numeric expression that is +1 (Positive),-1 (Negative), and 0(Zero). This article explains how to use the SIGN function with an example and the syntax for finding the signs of numbers is as shown below.
SIGN(<<numeric_expression>>)
To demonstrate the SIGN function, we use the Product table below, which has 14 records. Please refer to the Derived Column Transformation, Union All Transformation, Built-in Functions, and SQL Server articles in SSIS.
SSIS SIGN function
For this SIGN example, 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 product table. Please join the OLE DB Source to Derived Column because it helps to write SIGN expressions and create new columns.
Next, double-click on it to open the Derived Column Transformation Editor. Drag and drop the SSIS SIGN function to the row cell under the Expression and replace the numeric_expression with the Grade column to return the +1, -1, and 0 sign values. Either you can manually delete the complete numeric_expression or drag and drop the Grade column will automatically replace it.
SIGN( [Grade] )
SIGN( [StandardCost] - [SalesAmount] )
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 SIGN function package to see the +1, -1, and 0 sign values of the Grade column and the sales profit.