sadie519590


Hi,

With DTS, the default behavior is to import blanks ("") in a data file as nulls in the table.

However, in SSIS, the default behavior is to import blanks as blanks.

I need to ensure that the packages I'm migrating import the data in the exact same way. I am wondering what is the easiest way to convert blanks to nulls

Right now I'm using a script to convert the blanks to nulls before they are written to the table, but just wondering if there's an easier way.

Thanks




Re: data file blanks to nulls

jwelch


You can use a Derived Column as well (NULL(DT_*)). If you aren't dealing with many columns, the Derived Column approach is fine. However, if you have a lot of columns to check, the script approach can be easier, as you can set it up to process all the columns generically, checking for and replacing blanks.







Re: data file blanks to nulls

Bhargavi Srivathsan

If you are using FlatFile source to read the data, try enbaling the checkbox that says "Retain null values from the source as null values in the data flow" in the Flat File Source editor.

Hope this helps...





Re: data file blanks to nulls

sadie

Hi,

Do you have an example of how to process the columns generically I'm not sure how I would do this, but that would be helpful!

Thanks





Re: data file blanks to nulls

jwelch

I posted two examples here: http://agilebi.com/cs/blogs/jwelch/archive/2007/10/21/address-columns-generically-in-a-script-task.aspx

Hopefully these help you see how this can be done.






Re: data file blanks to nulls

sadie

Thanks

I





Re: data file blanks to nulls

sadie

Thanks

I supposed I





Re: data file blanks to nulls

sadie

Thanks

I suppose





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process numerics in s





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process numerics in a





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process numerics in a separate s





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process numerics in a separate script





Re: data file blanks to nulls

sadie

Thanks

I suppose could set this up to process numerics in a separate script (only