If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > How to monitor a job

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-03, 04:19
ligang ligang is offline
Registered User
 
Join Date: Aug 2002
Location: Shanghai , China
Posts: 63
How to monitor a job

How to monitor a job ?
which system table can be used to query the status of a JOB ( executing , executed or other ?)
__________________
Oracle is an ocean . I am just a little fish
Reply With Quote
  #2 (permalink)  
Old 02-27-03, 10:38
Paul Young Paul Young is offline
Registered User
 
Join Date: Feb 2002
Location: Houston, TX
Posts: 809
I believe sysjobhistory is what you are looking for. You might also want to checkout msdb.dbo.sp_help_job if yo uwish to roll your own code.
__________________
Paul Young
(Knowledge is power! Get some!)
Reply With Quote
  #3 (permalink)  
Old 02-27-03, 10:46
msieben msieben is offline
Registered User
 
Join Date: Feb 2003
Location: Germany
Posts: 53
Re: How to monitor a job

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On