Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

List Jobs, Schedules, and Next Scheduled Run datetimes

Asked by Carl Paige Apr 22, 2021 7 views 1 answer
Share

About this question

List Jobs, Schedules, and Next Scheduled Run Datetimes I'm trying to list Jobs, Schedules, and Next Scheduled Run Datetimes. However, I don't appear to be succeeding.


sysjobactivity has next_scheduled_run_date, which is what I need, but I cannot figure out to connect it to both the Job and Schedule. If there's a way other than through sysjobactivity, please guide me there.
SELECT sj.name AS jobName , ss.name AS scheduleName , sja.next_scheduled_run_date FROM msdb.dbo.sysjobs sj INNER JOIN msdb.dbo.sysjobactivity sja ON sja.job_id = sj.job_id INNER JOIN msdb.dbo.sysjobschedules sjs ON sjs.job_id = sja.job_id INNER JOIN msdb.dbo.sysschedules ss ON ss.schedule_id = sjs.schedule_id WHERE (sj.name LIKE 'xray%') AND (sja.next_scheduled_run_date > GETDATE())


Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.