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 Development (2000)
 Programmatically ReSchedule a task

Author  Topic 

wd7179
Starting Member

10 Posts

Posted - 2004-10-25 : 17:39:14
My question revolves around my need to run a task on the third business day of every month.

I can schedule the task and have some other program run it with the third business logic written into it, but I would prefer to have all the logic inside of SQL Server.

In my research,I found a table, sysJobSchedules, that houses the job schedule info. What I was wondering is, can I write a procedure to update the next_run_date and time columns?

My concern is that I will mess up some kind of internal mechanism for the scheduler.

Thanks for any help you can provide.

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-10-25 : 17:45:31
You can check this procedure to see if it fits the bill...
sp_update_jobschedule
( it might be easier to use sp_delete_jobschedule + sp_add_jobschedule )
Don't update the system tables directly!

rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-10-25 : 22:11:08
You might find it wasier to run it every day and put code in to exit if it's not the run date.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -