0
votes

In an SSIS package I am using a flat file source with a date column, and some of the dates are empty strings. I want these empty strings to be treated as null when the data from the file is loaded into the database. I have checked the "Retain null values from the source as null values in the data flow" checkbox in the Flat File Source Editor, but when I execute the task I get the error "The value could not be converted because of a potential loss of data". How can I get the SSIS package to treat the empty date strings as nulls?

1
Are they blank values in the flat file or actually the word NULL - Raj More

1 Answers

1
votes

Use the following expression:

TRIM( [ColumnName] ) == “” ? (DT_STR, 8, 1252)NULL(DT_STR, [length], 1252) : [ColumnName]