0

I have a to make a document on all the SQL Jobs in out DB servers with the trigger times, is there a way of getting all the trigger times from msdb, without going to every job under SQL server agent and checking the properties.

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
CSharped
  • 1,247
  • 4
  • 20
  • 49

1 Answers1

1

I think you need this:

select 
    j.job_id,
    j.name,
    s1.next_run_date,
    s1.next_run_time,
    s2.*
from msdb.dbo.sysjobs j
left outer join msdb.dbo.sysjobschedules s1
    on j.job_id=s1.job_id
left outer join msdb.dbo.sysschedules s2
        on s1.schedule_id=s2.schedule_id
Andrew
  • 8,445
  • 3
  • 28
  • 46