SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Flat File Import Error


SSIS Flat File Import Error

Author
Message
myoda
myoda
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 88
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
happycat59
happycat59
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8343 Visits: 3281
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.



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