Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS 2005 blank values problem Expand / Collapse
Author
Message
Posted Friday, July 19, 2013 10:53 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 2:54 PM
Points: 105, Visits: 474
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!!
Post #1475604
Posted Monday, July 22, 2013 11:28 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 8:25 AM
Points: 461, Visits: 1,686

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.
Post #1476161
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse