Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert blank into null in ssis

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?

like image 673
Sandeep Pulikonda Avatar asked Oct 24 '12 16:10

Sandeep Pulikonda


People also ask

How do I replace blanks in SSIS?

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.

Is NULL in SSIS Expression?

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.

How do you convert NULL to blank?

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.


1 Answers

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

like image 154
Farfarak Avatar answered Sep 17 '22 20:09

Farfarak