Neil P
Neil P

Reputation: 3190

SSIS how to set a null identifier for a flat file source?

Using SSIS, I am trying to import a csv file that uses

\N

to identify null values. Is there any way in ssis I can configure the data source to recognise these as nulls, instead of a string "\N".

I know I could use a data conversion to do this, but using the source would be more elegant if possible!

Upvotes: 2

Views: 226

Answers (1)

Rather than using a data conversion task, you could use a derived column task to take that value and implement an expression so that when your value is /N you can actually return null instead for that column.

Expression approximately

[MyCol] == "\\N" ? NULL(DT_WSTR, 50) : [MyCol]

Upvotes: 4

Related Questions