tags:

views:

460

answers:

1

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?

Thanks

+1  A: 

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

Exit codes returned from dtexec utility

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.

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.

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.

William Todd Salzman
Thanks. I think we're going to have the package write to a "job status" table when it fails. The scheduler can then check the table to determine how to handle the failure.

related questions