July 19, 2013 at 10:53 am
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!!
July 22, 2013 at 11:28 am
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.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply