In SQL Agent, under the properties of a job, there is a notification tab
where you can direct it to send you an email if a job fails. However, that
email appears to contain the history for the overall job, but not the
history detail for the particular step that failed.
For example, the email text I get from my failed job (which has only 1 step)
is:
JOB RUN: 'svCON Check WS02' was run on 10/27/2003 at 10:21:31 AM
DURATION: 0 hours, 0 minutes, 1 seconds
STATUS: Failed
MESSAGES: The job failed. The Job was invoked by User sa. The last step to
run was step 1 (check WS02).
Not very useful. If I right click on the job, choose "View Job History..."
and then check the box for "Show Step Details", then I can click on the row
for Step 1 and see a more precise message:
Executed as user: sa. WS02 workstation did not check in. Last check in was:
Sep 11 2000 7:05AM [SQLSTATE 42000] (Error 50000). The step failed.
Does anyone know how I can add this step history info to the job's email
notification?You can't do it unless you write your own code.
Besides, the purpose of email notification is to let you
know what has failed and then manual intervention by an
operator or dba will be required to fix it.
>--Original Message--
>In SQL Agent, under the properties of a job, there is a
notification tab
>where you can direct it to send you an email if a job
fails. However, that
>email appears to contain the history for the overall job,
but not the
>history detail for the particular step that failed.
>For example, the email text I get from my failed job
(which has only 1 step)
>is:
>JOB RUN: 'svCON Check WS02' was run on 10/27/2003 at
10:21:31 AM
>DURATION: 0 hours, 0 minutes, 1 seconds
>STATUS: Failed
>MESSAGES: The job failed. The Job was invoked by User
sa. The last step to
>run was step 1 (check WS02).
>Not very useful. If I right click on the job,
choose "View Job History..."
>and then check the box for "Show Step Details", then I
can click on the row
>for Step 1 and see a more precise message:
>Executed as user: sa. WS02 workstation did not check in.
Last check in was:
>Sep 11 2000 7:05AM [SQLSTATE 42000] (Error 50000). The
step failed.
>Does anyone know how I can add this step history info to
the job's email
>notification?
>
>.
>
No comments:
Post a Comment