Search code examples
sql-serverssissql-server-2016derived-column

Create Null-able numeric column in Derived column component


I use SSIS in SQL Server 2016. I have to create a new column in my DataFlow. I use DrivedColumn component to create this new column. In this case I need a nullable numeric column like below image :

enter image description here

As you can see, I have error in this case.

How can I create null-able numeric in Derived column component?


Solution

  • In the derived column task there are NULL Functions that you can use if you would like to set a value to NULL. Select the appropriate NULL function that corresponds to the datatype of your column and plug that into your equation.

    You can use NULL(DT_CY) if your column is defined as currency.
    Example. ([currencyAmount]>0? [currencyAmount]:NULL(DT_CY)

    In the Derived Column task Null Functions can be found here: enter image description here