Groups | Blog | Home
all groups > sql server dts > september 2007 >

sql server dts : Source Excel's null value overrides destination table column default value


michaelt
9/27/2007 11:33:07 AM
Using SSIS 2005, I am importing an excel worksheet whose column c
(formatted as number) has some null values. The destination table
column "c" (datatype of float) has a default of 0.

After executing the SSIS package, there's are NULL values instead
0's. Why is this? Is there a package config I have to set to tell
the package to use table column default value when source value is
null?

In DTS 2000, there was no issue.

Thanks
jhofmeyr NO[at]SPAM googlemail.com
10/2/2007 12:00:00 AM
[quoted text, click to view]

Hi Michaelt

If you change the Data Access Mode option in your OLEDB Destination
task to "Table or view - fast load" then there is an option to Keep
Nulls, having this unchecked will product the results you are looking
for. It seems although this option is hidden when you select the
default Data Access Mode ("Table or view") it is checked.

You might be better off dealing with the NULL's in the SSIS package
instead of letting the database generate the values - this gives more
visibility to anyone else who might have to take over support of the
system at a later date. To do this use a Derived Column task and
Replace the column using an expression like this:
ISNULL(<column>) ? <default value> : <column>

Good Luck
J
michaelt
10/2/2007 5:01:04 PM
[quoted text, click to view]

Thx J,

Your latter suggestion was what I went with, right on!
AddThis Social Bookmark Button