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 Flat File Import Error Expand / Collapse
Author
Message
Posted Tuesday, September 10, 2013 12:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 28, 2014 8:33 AM
Points: 2, Visits: 49
Hello,

I am having an issue importing a flat file into an SSIS package. The file I am importing has a footer and header that have fewer fields than the rest of the file, I set flat file connection to skip the header row. The file is usually pretty small, just a few records, and it usually runs just fine, but the file that came in the other day was a bit bigger, 17 records or so, and it ended up failing.

I am using SQL Server 2005, and Visual Studio 2005.

Here are the errors messages I get:

[ACT_RLP input file [116792]] Warning: There is a partial row at the end of the file.

SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "ACT_RLP input file" (116792) returned error code 0x80040E21. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited.

SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled.

SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.

SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.


None of that really means much to me, but I believe the problem is with the footer.

Here is what the footer looks like: "+|9|9999999|16|9|20130906|LOAD-DELTA : ALP |LGNT |1|21|0|17|2"

It's pipe delimeted, I have found that the file will run successfully if I change the file like:

1. remove the footer.
2. add a pipe to the end of the footer.
3. add an empty footer line to the end of the file like "+|||||||||||||"

I have also found the file will load successfully if I change the 12th field, the "17" to a single digit, 0 - 9, so finding that out I looked into the flat file connection manager, and the 12th field, which was a status_code had a OutputColumnWidth of 1, I changed it to 2 and the file ran successfully.

So, I am just wondering if anyone has any suggestions how to solve this problem without changing the field length of one of my fields, or manipulating the actual file.

Thanks
Post #1493329
Posted Tuesday, September 10, 2013 10:03 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:21 PM
Points: 2,842, Visits: 2,423
Unfortunately for you, the flat file source expects all records in the file to have the same structure. So, if you have a different number of fields in your trailer, you have a problem.

One possible solution is to split up the file into separate files based on the type of data in each record - use the flat file import but treat each record as a single field and do a conditional split based on the record type. Write the output from each output from the conditional split to a separate file. Now you can import each of the resultant files using separate connection managers which are configured to have the correct number of columns for each of the records.



Post #1493434
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse