Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Posts
    1

    Talking Unanswered: Status Field In Management - Jobs

    I am trying get the status field from the list of jobs in management. I have a activex script that queries system tables to find out if a job has failed and sends the report via e-mail.

    Currently I use this query to get the names of jobs failed...
    SELECT
    name
    FROM msdb.dbo.sysjobs A, msdb.dbo.sysjobservers B WHERE A.job_id = B.job_id AND B.last_run_outcome = 0
    ORDER BY name

    I need to add some criteria around the status field to get the appropriate results.

    anybody?
    Cheers

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    I think you want to take a look at the current_execution_status column returned by this proc:

    exec msdb.dbo.sp_help_job

    see BOL for what the values mean: http://msdn2.microsoft.com/en-us/library/ms186722.aspx

Posting Permissions

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