Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Retrieving schedule information about a job.

Author  Topic 

slacker
Posting Yak Master

115 Posts

Posted - 2004-09-28 : 13:07:43
I have been messing around with some of the job stored procedures
sp_add_job,
sp_add_jobschedule

etc..

I have a job step to which run once schedules are added by my application via the sp_add_jobschedule stored proc. What I would like to be able to do is retrieve the schedule name of the current schedule that is running within the job step. Possible?

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-09-29 : 01:47:33
Have you looked at the sysjobschedules table?
[CODE]
Select sj.name, sjs.name as Schedule, sjs.enabled as Sch_Enabled, sjs.active_start_date as Start_Date,
active_start_time as Start_Time, next_run_date as Run_Date, sjs.next_run_time as Run_Time
from msdb.dbo.sysjobschedules sjs
join msdb.dbo.sysjobs sj
on sjs.job_id = sj.job_id
where sj.enabled = 1
order by Sch_Enabled desc, Run_Date, Run_Time
[/CODE]

Duane.
Go to Top of Page

slacker
Posting Yak Master

115 Posts

Posted - 2004-09-29 : 14:29:47
Works perfectly for what I need. Thank you.
Go to Top of Page
   

- Advertisement -