Here's a sample script for failed backup jobs:SELECT j.name, --js.server, js.run_date, js.run_time, --js.run_duration, CONVERT(VARCHAR(10),CONVERT(DATETIME,RTRIM(19000101))+(js.run_duration * 9 + js.run_duration % 10000 * 6 + js.run_duration % 100 * 10) / 216e4,108) AS run_duration ,SERVERPROPERTY('productversion') FROM msdb.dbo.sysjobs jINNER JOIN msdb.dbo.sysjobhistory js ON j.job_id = js.job_idWHERE NAME LIKE '%Backup%'AND js.step_id = 0AND js.run_status = 0 -- (0 = Failed, 1 = Sucess)AND j.enabled = 1AND run_date > '20120305'ORDER BY js.server, j.name
Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog