Quote:
Originally posted by ligang
How to monitor a job ?
which system table can be used to query the status of a JOB ( executing , executed or other ?)
|
we use something like this to display job informations
SELECT
sjv.job_id,
name = convert(varchar(100),sjv.name),
sjv.enabled,
last_run_info =
( select top 1 convert(varchar,run_status)+'*'+convert(varchar,jh ****n_Date)+'*'+convert(varchar,jh****n_time)
from msdb.dbo.sysjobhistory jh where jh.job_id=sjv.job_id and jh.step_id=0
order by run_date desc, run_time desc )
FROM msdb.dbo.sysjobs_view sjv