November 13, 2015 at 3:45 pm
Hi,
We have a Sql job, which has two steps. When I check under the job history it is showing failed. But for each step it is showing the status is success.
I am confused how the job is failed when each step is showing success
November 13, 2015 at 10:17 pm
How did you determine the job failed? Did you seen a red icon? Can you upload its image? Double-click the job, double-click a job step, and click the Advanced tab. What actions are taken on success and on failure?
November 15, 2015 at 9:20 pm
I am attaching the image of job history below.
On the success action: Go to the next step
On Failure action: Quit the job reporting failure
I can see the each job step is succeeding but finally the output is showing failure with red icon.
November 15, 2015 at 9:39 pm
No idea. If one of those steps is a CmdExec job step, a wild guess is that the step's command-line executable successfully ran, but raises a non-zero return code (which the job step considers a failure). Command-line executables should use 0 for success, but there are some that don't. One common example is robocopy, which can raise a non-zero return code, even though robocopy successfully runs. Fixing Robocopy for SQL Server Jobs . If the failure concerns a CmdExec step that is invoking some other command-line executable, you need to check that executable's documentation 🙂
November 15, 2015 at 10:12 pm
The both steps are just T-SQL steps. There are no cmdexe
November 15, 2015 at 10:30 pm
At the bottom of the Job History screen is a job details pane, if you scroll down in there it will likely give you an explanation or at least an indication, I expected that to be the screenshot you posted.
...
November 16, 2015 at 1:29 am
Check the exit commands of the job steps.
Is the last one's on success action, quit job reporting failure by any chance?
November 16, 2015 at 9:19 am
Thank you.
Yes, for the last step on success action: quit the job reporting failure.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply