SQL JOB Status history is showing failed

  • 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

  • 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?

  • 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.

  • 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 🙂

  • The both steps are just T-SQL steps. There are no cmdexe

  • 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.

    ...

  • Check the exit commands of the job steps.

    Is the last one's on success action, quit job reporting failure by any chance?

  • 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