It would be nice with a build in option to trigger notifications based on failed Agent Jobs.
We are currently using this custom SQL Query in 'msdb':
SELECT STUFF((SELECT N', '+ name FROM (SELECT name FROM dbo.sysjobs WHERE (SELECT TOP 1 run_status FROM dbo.sysjobhistory WHERE (step_id =0) AND (job_id = sysjobs.job_id) ORDER BY run_date DESC, run_time DESC)=0 AND (enabled =1)) AS [n1] FOR XML PATH(''),TYPE).value('text()[1]','nvarchar(max)'),1,2,N'') AS [Failed]
It would be nice with a build in option to trigger notifications based on failed Agent Jobs.
We are currently using this custom SQL Query in 'msdb':
// Martin.