Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to skip wrong excel files (ignore errors on SSIS Foreach task)?

$
0
0

Hello Everyone!

I am new to SSIS.

I created a package which is meant to move some excel files to database, all of a similar format. 
I would like the files that contain the errors were skipped by the package, but every time I run package execution stops at the wrong file, and the package fails.

Control Flow consists of a Foreach Task with Dataflow which is copying data from the sheet to database table.
The Dataflow has two outputs (constraints) one for good files and one for bad.
I simulate wrong file with zero-length file called errortest.xlsx

I've read posts that look like they describe my problem, e.g. "Ignore errors in package" - http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/7b19149d-5d6c-4171-803d-fe247886df1f
but the above methods do not work in my case and I don't know why, maybe because they refer to SSIS 2005 and I am using SSIS 2008 R2.

I tried the following techniques
- Created error handler on foreach task and dataflow task level, and I have set a propagate variable to false on both of them.
- I set the ForceExecutionResult property to Success on DataFlow 
- I set the ValidateExternalMetadata to false on Excel Source

Effect:

Execution stops on first wrong file turnning dataflow and foreach tasks blocks to red, package fails.
I did not set MaximumErrorCount because I want to catch them and I don't know how many files (potential errors) there will be to load.

I am stuck, any help appreciated

Karol

Output contains following errors:

Error: 0xC0202009 at Package, Connection manager "Excel Connection Manager": SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "Zewnętrzna tabela nie ma oczekiwanego formatu.".

Error: 0xC020801C at Data Flow Task, Excel Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Error: 0xC0047017 at Data Flow Task, SSIS.Pipeline: component "Excel Source" (1) failed validation and returned error code 0xC020801C.

Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.

Error: 0xC0024107 at Data Flow Task: There were errors during task validation.

Warning: 0x80019002 at Foreach Loop Container: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>