Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL*Server Job notifications

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-06-28 : 10:37:47
Michael writes "I'm trying to capture JOB failure information when a JOB fails. I undertand there are SP_HELP* procedures... but all i want back is the jobname and failure time.

What would be the syntax to return this to a STRING used as part of an email notification?

TIA!"

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-06-28 : 10:54:05
You can do what you are trying to accomplish by adding an alert to your job from with the enterprise manager on the notifications tab of the job properties ot using the sp_add_alert system syored procedure.

Sean Roussy

Please backup all of your databases including master, msdb and model on a regular basis. I am tired of telling people they are screwed. The job you save may be your own.

I am available for consulting work. Just email me though the forum.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-06-28 : 23:53:13
another option:

add a job step that will be invoked when the job fails,
call your emailing procedure in this job step passing the name of the job and time as parameters in your body or subject line,
whatever fits your need

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -