Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS 2005 blank values problem


SSIS 2005 blank values problem

Author
Message
rockstar283
rockstar283
SSC-Enthusiastic
SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)SSC-Enthusiastic (130 reputation)

Group: General Forum Members
Points: 130 Visits: 669
I am using a package to load data from a tab delimited flat file into SQL server table.

For this purpose, I am using SSIS 2005 and SQL server 2005.

In the connections manager for flat file source, I have a column AcqDate which I have declared as a Date. When I run the package, the package fails after processing 5800 rows as 5801 row's AcqDate is blank. The package fails in the flat file source adapter when it tries to pull data from the flat file.

If I run the same package in 2008, it runs successfully.

Is there any way to solve this problem?

Thanks in advance!!
kl25
kl25
Mr or Mrs. 500
Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)

Group: General Forum Members
Points: 514 Visits: 1875

In the connections manager for flat file source, I have a column AcqDate which I have declared as a Date. When I run the package, the package fails after processing 5800 rows as 5801 row's AcqDate is blank. The package fails in the flat file source adapter when it tries to pull data from the flat file.


Using SQL Server 2005 and BIDS 2005, I could only reproduce this issue in the following way:

1. Destination table: column receiving the date is NOT NULL.
2. Flat File Source Editor: 'Retain null values from the source as null values in the data flow' checked AND
3. OLE DB Destination Editor: 'Keep nulls' checked

With this scenario, the data ahead of the null was inserted, the tasked failed at the null and no further data inserted.

If the receiving column was NOT NULL, the Flat File source did not allow nulls (unchecked) but the OLE DB Destination did allow nulls, an SSIS default value of 1899-12-30 was inserted. The same was true even if the receiving column was NULL.

I could retain the nulls by setting the destination column as NULL and setting both the source and destination in SSIS to retain nulls.

If this configuration is not possible, you might consider a derived column to handle nulls using a string expression to manage the null however you'd like to get a valid date and then casting to date.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search