Skip to content

Instantly share code, notes, and snippets.

@troyscott
Created April 10, 2013 20:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troyscott/5358185 to your computer and use it in GitHub Desktop.
Save troyscott/5358185 to your computer and use it in GitHub Desktop.
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