January 30, 2009 at 2:36 am
Need some advise!
I have several databases in my SQL 2005 environment which all have several jobs associated with them.
I would like one central DB which holds all Success and Failure information in one tables.
i.e. For each success or failure job completion it will write a row in the table with information like:
Database Name, Job Name, time started, success, fail, error message
Can this be done?
January 30, 2009 at 3:29 am
are the jobs sql agent jobs? if so, the details will be in msdb. otherwise you could add extra steps into the job which insert details into a logging table when the job is successful or fails.
January 30, 2009 at 3:38 am
Yes the jobs are sql agent jobs.
Let me check the msdb..
Thanks
January 30, 2009 at 3:55 am
Ok so far I can see 3 tables which help:
sysjobhistory
sysjob
sysjobschedules
joing them together im getting some good data but missing the most important 'Error Message'
i.e. I need the information describled in the Job History message
So far my SQL looks like:
select jh.Server as ServerName, j.name as JobName,
jh.Step_Name,jh.Message,jh.Run_Date as LastRunDate
from sysjobhistory jh
join sysjobs j
on jh.job_id = j.job_id
January 30, 2009 at 4:19 am
Ok i lied, iv got the Job History thanks!!!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply