Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check error level after the SSIS package completes. If the error level does not 0 stop running the batch file.
@ECHO OFF
SET DTEXEC_PATH="C:\Program Files\Microsoft SQL Server\110\DTS\Binn\dtexec.exe"
%DTEXEC_PATH% /FILE batch_success.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB
%DTEXEC_PATH% /FILE batch_fail.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB
%DTEXEC_PATH% /FILE batch_success.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB
GOTO END
:STOP_JOB
GOTO END
:END
@wjx0912
Copy link

wjx0912 commented Apr 30, 2021

good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment