Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Select the last error in the job selected

By Ludwig Guevara,

The job will send an HTML email with the latest error at specific job.

How to:

  1.  Add a last step at your already created job called "Send Failure Notification" pointing to the Database where you have the previous script.
  2.  in the Command window put:

-- Send Failure Notification

-- Required parameter to whom are you sending this email

'<group or name>@<company>.com'

-- Required parameter - job_id

, '<job_id>'

-- Optional parameter - default is 1 minute
, <Minutes>

-- Optional parameter - default is low
, <level of importance>




, 'E1A5E99B-3A30-40D5-B32D-89DBC78936DB'

Total article views: 865 | Views in the last 30 days: 2
Related Articles

Parameter to Parameter

Parameter Values


Parameter Dependency

Parameter Dependency


Parameter issue

Parameter issue


Multiple parameters

Multiple parameters


Multiple report parameters

Parameter dependency

job history    
sql jobs