Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Shanghai , China
    Posts
    63

    Unanswered: 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

  2. #2
    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!)

  3. #3
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    53

    Re: How to monitor a job

    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 .run_Date)+'*'+convert(varchar,jh.run_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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •