如何使 EXE 文件中的 SSIS 作业失败 [英] How to fail an SSIS Job from an EXE file

查看:20
本文介绍了如何使 EXE 文件中的 SSIS 作业失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个由 SSIS 作业触发的应用程序,需要 2 到 120 分钟的执行时间.我现在想知道是否使用 SSIS 的监视和报告功能执行 EXE 文件失败.我当然在应用程序中有日志记录,但更多的是用于调试,我需要能够使用 SSIS 作业功能发送通知.

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.

是否有特定的返回值可以告诉 SSIS 作业 EXE 文件的执行失败?还是我需要自己在 Workflow 中实现这样的功能?

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?

推荐答案

不清楚您是如何从 SSIS 中执行此 EXE 的.我将不得不假设它是一个执行流程任务.

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.

因此,设置您的 EXE 以遵循返回值的标准约定.如果执行成功,则返回零,并返回任何其他值以报告失败.(您可以有不同的值代表不同的失败模式.)您的执行流程任务将指定零作为成功值(默认值),如果返回值不是成功值(也是默认值),则失败.然后,您可以使用故障约束路由控制流,以通过发送邮件任务或您想要的任何其他方式报告故障.

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.

这篇关于如何使 EXE 文件中的 SSIS 作业失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆