Martin Stevnhoved Posted May 27, 2016 Share Posted May 27, 2016 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] // Martin. Paul 1 Link to comment Share on other sites More sharing options...
Martin Stevnhoved Posted February 10, 2017 Author Share Posted February 10, 2017 Any status? The following SQL script shows all failed (and enabled) agent jobs: SELECT name FROM msdb.dbo.sysjobs WHERE ((SELECT TOP (1) run_status FROM dbo.sysjobhistory WHERE (step_id = 0) AND (job_id = dbo.sysjobs.job_id) ORDER BY run_date DESC, run_time DESC) = 0) AND (enabled = 1) Link to comment Share on other sites More sharing options...
Administrators Paul Posted February 13, 2017 Administrators Share Posted February 13, 2017 Hi Martin, Thanks. I've pushed this into our todo list. It will be picked by the development team and we'll notify you when this is implemented. -Paul Martin Stevnhoved 1 Link to comment Share on other sites More sharing options...
Martin Stevnhoved Posted November 29, 2018 Author Share Posted November 29, 2018 (edited) Any status @Paul? Edited December 4, 2018 by Martin Stevnhoved Link to comment Share on other sites More sharing options...
Administrators Paul Posted December 20, 2018 Administrators Share Posted December 20, 2018 Hi Martin, This is still on our backlog for the SQL server module. As soon as we touch that module we'll be adding this notification too . -Paul Tyson and Martin Stevnhoved 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now