x
login about faq Site discussion (meta-askssc)

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

more ▼

asked Jan 05 '12 at 03:00 AM in Default

aRookieBIdev gravatar image

aRookieBIdev
2k 24 39 46

(comments are locked)
10|1200 characters needed characters left

1 answer: sort newest

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]
more ▼

answered Jan 05 '12 at 03:30 AM

Usman Butt gravatar image

Usman Butt
13.8k 6 8 14

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.

Jan 06 '12 at 04:43 AM aRookieBIdev

Sorry about it . What u suggested works fine, Thanks again

Jan 06 '12 at 05:10 AM aRookieBIdev
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x749
x25
x22
x11

asked: Jan 05 '12 at 03:00 AM

Seen: 1228 times

Last Updated: Jan 05 '12 at 03:00 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.