question

aRookieBIdev avatar image
aRookieBIdev asked

SSIS Null value for Integers

Hi , I am trying to load data from a flatfile to SQL Table. I have a condition where if there are blank values for fields then I have to upload null in the tables and if there are values then i need to convert them to integer and upload to the tables. I was using data conversion task but can any one suggest how to handle the null value in derived column. Thanks, Kannan
ssisnulldata-conversioncast-convert
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Usman Butt avatar image
Usman Butt answered
I guess you can use the expression in the derived column something like TRIM([YOURSTRINGFIELD]) == "" ? NULL(DT_NUMERIC, «precision», «scale») : (DT_NUMERIC, «precision», «scale»)[YOURSTRINGFIELD]
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi thanks for your reply , I tried this but I was able to insert only 0 , but i need null values in my db tables.
0 Likes 0 ·
Sorry about it . What u suggested works fine, Thanks again
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.