Bhaskar Rai
Bhaskar Rai

Reputation: 9

SSIS: Populating NULL instead of blank values in Excel Destination

I have a Data flow task where I am extracting an excel file from OLE DB source.

So my Control Flow is like File System Task => DFT(OLE DB Source => Excel Destination).

I have a template of excel file that gets copied by File system task and then the data is extracted from ole db soure to Excel file.

If there are blank values I need to populate them as NULL in Excel. How can I do that? I tried to use derived column but was not successful.

Help would be appreciated

Upvotes: 0

Views: 239

Answers (1)

Amira Bedhiafi
Amira Bedhiafi

Reputation: 1

You may need to add a Data Conversion transformation task between the OLE DB source and the Excel destination where you can convert the columns that may contain blank values to a data type that allows NULLs, such as DT_WSTR for string columns.

In your Derived Column transformation task after the Data Conversion task, you can use the following :

TRIM(column_name) == "" ? NULL(DT_WSTR,50) : column_name

Upvotes: 0

Related Questions