I am extracting data from excel in ssis
. One of the excel column contain blank
values. so i need to replace blank
value with null otherwise my package is going to fail. Any suggessions?
Solution: We will be using Derived Column Transformation in our SSIS Package to replace these blank values with Null. Drag Derived Column Transformation to Data Flow Pane and connect the Flat File Source to it. Add a new column DER_Address and write expression as shown below in fig 2.
SSIS REPLACENULL Syntax and Example So if expression1 is NULL, it will be replaced by expression2 by the derived column transformation. If it is not NULL, expression1 itself is returned. If both are NULL, NULL is returned.
There are two ways to replace NULL with blank values in SQL Server, function ISNULL(), and COALESCE(). Both functions replace the value you provide when the argument is NULL like ISNULL(column, '') will return empty String if the column value is NULL.
In DataFlow use DerivedColumn component.
Replace your column and in expression put this line of code
ColumnName == "" ? NULL(DT_WSTR,50) : ColumnName
It will make sure to return null if column is empty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With