Giorgi Nakeuri
Giorgi Nakeuri

Reputation: 35790

Pass exception to SSIS process

I have created a console application that does some work with CSV file and loads data to SQL Server table. This application is called from SSIS Execute Process Task.

Unfortunately I have no idea of SSIS packages but the question is: can I somehow pass an exception into SSIS process so it can redirect the flow? What is the pattern? Is there some pipe or something like this where I can pass exceptions or some messages?

Upvotes: 2

Views: 666

Answers (2)

billinkc
billinkc

Reputation: 61249

The Execute Process Task has for 3 channels for communication: stdin, stdout, stderr.

You wouldn't be able to propagate your error intact but you could try serializing it as a standard error message and then assign that to a Variable within SSIS. You'd then need to either have a Script Task as a successor that reconstitutes the error message into a .NET level Exception that you then throw or you take the cheap and lazy way out of assuming that if variable stderr is populated, then the invoked process was bad and you fail out the SSIS package - or take whatever evasive countermeasures you need.

The former likely results in the package failing with exceptions while the latter is a more controlled failure...

Execute Process Task reference questions

Upvotes: 1

Jeffrey Van Laethem
Jeffrey Van Laethem

Reputation: 2651

You should be able to add an Event Handler to your package for that particular task that can handle the error appropriately. Not sure about getting the exact exception back into SSIS since you're calling an external application though.

Upvotes: 0

Related Questions