Exit Codes, DTEXEC, and SSIS Catalog

DTEXEC has two execution modes when running packages in the SSIS Catalog.

By default, the process runs asynchronously – the package execution is scheduled on the server, and DTEXEC returns immediately. DTEXEC does not wait for the package execution to complete. In this case, %ERRORLEVEL% would represent whether the package execution was created successfully, and will not reflect the result of the execution.

To get the result of the package execution, you can set the $ServerOption::SYNCHRONIZED property to True. In this mode, DTEXEC will wait for the package execution to complete. If the execution was successful, the %ERRORLEVEL% will be set to 0. If it failed, it will be set to 1.

See the examples below – the first execution runs a package (2-RowCounts.dtsx) on my local instance, and completes successfully. The second execution runs a package (6-ErrorContext.dtsx) that will fail.

 

For more details on the new DTEXEC command line parameters for the SSIS Catalog, see:

5 thoughts on “Exit Codes, DTEXEC, and SSIS Catalog”

  1. This post applies to 2012.

    In previous versions of SSIS, DTEXEC always ran the package locally… there was no "server based execution".

  2. Has anyone else had an issue trying to run multiple packages simultaneously using Synchronous mode? I can only kick off 4 packages at a time or I begin getting timeouts connecting to the environment.

    1. Make sure you’re using the latest service pack. We fixed a few deadlocks in SSISDB after the RTM release which could cause a package to timeout/fail if you launch more than one at the same time. If you are on the latest SP, then check where the timeout is occurring … is a problem on the SSIS catalog server, or are you opening to many connections to your remote servers?

Leave a Reply

Your email address will not be published. Required fields are marked *