Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

NULL vs. Empty strings in CSV import

$
0
0

I am importing data from a CSV file into a SQLServer database via SSIS. I have a problem with string columns, in that SSIS inserts an empty string (eg. "") for a null column (eg ,,) by default. I can of course select the "retain null values" option in the Flat File Source Editor, however when I do this, it then treats zero-length strings (eg. "") as null as well as empty columns (eg ,,). My desired behaviour for string columns is below:

CSVDatabase

,,NULL

""""

Basically I'd like to know if there is a way of handling this distinction without resorting to derived columns, as I have 79 tables to process, each with multiple string columns so I'd really rather avoid that option.

Thanks for your help!


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>