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

What are List Jobs, Schedules, and Next Scheduled Run Datetimes?

Asked by Aashish Chaursiya Apr 23, 2021 512 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 hasnext_scheduled_run_date, which is what I need, but I cannot figure out how 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.