从命令行运行后如何从SSIS包中检测退出代码?

时间:2016-02-15 10:20:31

标签: command-line ssis

我有一个SSIS包,我从命令行运行。从命令行运行包后,我想检查退出代码。如果退出代码导致错误。然后我想登录到一个文本文件。我可以登录到文本文件,我只是无法检测到错误。有人可以帮忙吗?

到目前为止,我有这个:

C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn>dtexec.exe /f "T:\Development\.NET Projects\ReportingTool\DailyUpload_DEV\DailyUpload\DailyUpload_Morr.dtsx" <This is where I need the IF to check the return code> ECHO HELLO>>\\tw2-dc02\users$\Akilburn\Documents\text.txt

包裹在失败时返回:

DTExec: The package execution returned DTSER_FAILURE (1).

1 个答案:

答案 0 :(得分:0)

我正在检查错误的变量。 IF应该看起来像IF ERRORLEVEL 1 ECHO HELLO>>\\tw2-dc02\users$\Akilburn_MORR\Documents\text.txt