Skip to content

Instantly share code, notes, and snippets.

@troyscott
troyscott / check_errorlevels.bat
Created April 10, 2013 20:32
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