January 11, 2012 at 2:05 pm
I have a ssis pacakge. that import from flat source file to SQL table.
The flat file is generated from another system. I want to import to sql table.
We have a column in SQL table is PersonNumber as data type integer, and Nullable.We want to have null values instead of 0 in the table.
The flat souce file in that column has values and also blank values.
which we want to convert to null.
I used a derived column drvPerno= TRIM( [PerNo] ) == "" ? NULL(DT_WSTR,1) : Trim( [PerNo])
it succeeded to run in the step, but failed at the OLEDB destination, the eror is cannot convert , it cause data lose, I add a debug for showing the error output for OLEDB destination , it shows those records with perno as empty string values records there.
The thing I don't understand is it has already been converted to Null, but why they cannot be inserted into database?
I also tried to set it to 0 if '', converstion data view runs fine, just when get to the SQL table, it gives error: the data balue cannot be converted fro reasons other than sign mismatch or dataover flow
Thanks
January 11, 2012 at 2:43 pm
It is because you are passing a null value of the wrong type. You cannot use DT_WSTR in this case, because the destination field is expecting an integer value.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy