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 :
我在SQL Server 2016中使用SSIS。我必须在我的DataFlow中创建一个新的列。我使用DrivedColumn组件来创建这个新列。在这种情况下,我需要一个可空的数字列,如下图所示:
As you can see, I have error in this case.
正如你所看到的,在这种情况下我有错误。
How can I create null-able numeric in Derived column component?
如何在派生列组件中创建可空数值?
1 个解决方案
#1
3
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.
在派生列任务中,如果要将值设置为NULL,可以使用NULL函数。选择对应于您的列的数据类型的适当的空函数,并将其插入到您的等式中。
You can use NULL(DT_CY) if your column is defined as currency.
Example. ([currencyAmount]>0? [currencyAmount]:NULL(DT_CY)
如果列被定义为货币,可以使用NULL(DT_CY)。的例子。((currencyAmount)> 0 ?[currencyAmount]:空(DT_CY)
In the Derived Column task Null Functions can be found here:
在派生列task Null函数可以在这里找到:
#1
3
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.
在派生列任务中,如果要将值设置为NULL,可以使用NULL函数。选择对应于您的列的数据类型的适当的空函数,并将其插入到您的等式中。
You can use NULL(DT_CY) if your column is defined as currency.
Example. ([currencyAmount]>0? [currencyAmount]:NULL(DT_CY)
如果列被定义为货币,可以使用NULL(DT_CY)。的例子。((currencyAmount)> 0 ?[currencyAmount]:空(DT_CY)
In the Derived Column task Null Functions can be found here:
在派生列task Null函数可以在这里找到: