Saturday, September 14, 2013

SQLCMD Error output if using Batch script file

SQLCMD -S ServerName -E -b -i "D:\Test.sql"

if errorlevel 1 (
     Echo Error in scripts
     goto outerror1
 )

:outerror1
ECHO Batch job not ran successfully
EXIT 1

No comments:

Post a Comment