将退出代码从 SSIS 包返回到外部调度程序 [英] Returning exit code from an SSIS package to an external scheduler

查看:29
本文介绍了将退出代码从 SSIS 包返回到外部调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 dtexec 从外部调度程序 (Control-M) 运行 SSIS 包.我想根据包的哪一部分失败为调度程序提供不同的错误代码.有没有办法设置dtexec包失败时的返回码?

I'm running an SSIS package from an external scheduler (Control-M), using dtexec. I'd like to provide different error codes to the scheduler based on which part of the package failed. Is there any way to set the return code of dtexec on package failure?

如果没有,有没有人知道另一种将状态传送回调度程序的方法?

If not, does anyone know of another way to communicate a status back to the scheduler?

谢谢

推荐答案

似乎 DTEXEC 具有特定的退出代码列表,并且无法从包内以编程方式设置.此信息来自 http://msdn.microsoft.com/en-us/library/ms162810.aspx

It appears that the DTEXEC has a specific list of exit codes and cannot be set programatically from within a package. This information is from http://msdn.microsoft.com/en-us/library/ms162810.aspx

从 dtexec 返回的退出代码实用程序

Exit codes returned from dtexec utility

当一个包运行时,dtexec 可以返回退出代码.退出代码用于填充 ERRORLEVEL 变量,然后可以测试其值条件语句或分支批处理文件中的逻辑.这下表列出了这些值dtexec 实用程序可以设置何时退出.

When a package runs, dtexec can return an exit code. The exit code is used to populate the ERRORLEVEL variable, the value of which can then be tested in conditional statements or branching logic within a batch file. The following table lists the values that the dtexec utility can set when exiting.

值说明
0 包执行成功.
1 包失败.
3 包裹被用户取消.
4 实用程序无法找到请求的包.找不到包.
5 实用程序无法加载请求的包.无法加载包.
6 实用程序在命令行中遇到语法或语义错误的内部错误.

Value Description
0 The package executed successfully.
1 The package failed.
3 The package was canceled by the user.
4 The utility was unable to locate the requested package. The package could not be found.
5 The utility was unable to load the requested package. The package could not be loaded.
6 The utility encountered an internal error of syntactic or semantic errors in the command line.

我建议在您的包上使用多种类型的 SSIS 错误日志记录中的一种,然后使用另一个进程来检查日志,以防万一失败以确定您的失败在包中的哪个位置.

I would recommend using one of the many types of SSIS error logging on your package and then using another process to examine the logs in case of failure to determine where in the package your failure was.

这篇关于将退出代码从 SSIS 包返回到外部调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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