How to convert blank into null in ssis How to convert blank into null in ssis sql-server sql-server

How to convert blank into null in ssis


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


You might also want to check the option to Keep Null values on both source and destination connection (if available)


Did you tried something like (under assumption datatype is of string/varchar) :

LEN(TRIM([ColumnName]))==0 ? NULL(DT_WSTR, 10) : [ColumnName]