How to fail an SSIS Job from an EXE file

2019-08-24 01:51发布

I developed an Application that is being triggered by a SSIS Job and needs an execution time between 2 and 120 Minutes. I do now want to know if the execution of the EXE file failed or not using the monitoring and reporting functionality of SSIS. I do have logging of course in the application but that's more for debugging and I need to be able to send notifications using the SSIS Job functionality.

Is there a specific return value with wich I can tell the SSIS Job that the execution of the EXE file has failed? Or do I need to implement such a functionality in the Workflow by myself?

1条回答
混吃等死
2楼-- · 2019-08-24 02:10

It's not clear how you're executing this EXE from within SSIS. I'm going to have to assume it's with an Execute Process Task.

The Execute Process Task allows you to specify the Success Value you're expecting, and whether or not you want to fail the task if the return code is not the success value. I believe this is the property you want.

So, set up your EXE to follow the standard convention for return values. Return zero if the execution succeeded, and any other value to report failure. (You can have different values represent different failure modes.) Your Execute Process Task would specify zero as the Success Value (the default), and fail if the return value was not the Success Value (also the default). You could then have a failure constraint route the Control Flow to report failure via a Send Mail Task or whatever other means you want.

查看更多
登录 后发表回答