I've some weird situation. My autosys job status shows that it ran successfully but when I checked the logs it showed it was failed.
Is that possible ? Has anyone encountered this kind of issue ?
I've some weird situation. My autosys job status shows that it ran successfully but when I checked the logs it showed it was failed.
Is that possible ? Has anyone encountered this kind of issue ?
Use the -b option in the SQLCMD. This post gives a good explanation, and the solution worked for me... https://dba.stackexchange.com/questions/77298/how-to-make-sqlcmd-return-an-errorlevel-other-than-0-when-the-sql-script-fails
Taken from the above link...
You should use the option -b in sqlcmd.
-b Specifies that sqlcmd exits and returns a DOS ERRORLEVEL value when an error occurs. The value that is returned to the DOS ERRORLEVEL variable is 1 when the SQL Server error message has a severity level greater than 10; otherwise, the value returned is 0.