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.
| Author |
Topic |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-01-09 : 11:02:01
|
| How is it possible to schedule a job to run every 40 seconds.It seems every 1 minute is the shortest time available in the job properties for scheduling a job.Thanks |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-01-09 : 11:32:37
|
I think every minute is the highest freq that agent supports. elsasoft.org |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-01-09 : 11:45:51
|
| I have heard before that there is a way to reduce it to seconds.Just wondering if anyone knows how this is possible. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-01-09 : 11:59:04
|
Minutes are the smallest repeat interval that you can specify on a job.You can get a job to run every 40 seconds by setting up 3 different schedules:1. Schedule 1 starts at 00:00:00 and repeats every 2 minutes.2. Schedule 2 starts at 00:00:40 and repeats every 2 minutes.3. Schedule 3 starts at 00:01:20 and repeats every 2 minutes.Edit:The following is a more general solution to this problem. The query determines how many schedules you would have to setup to be able to run a job on a cycle of every N seconds.declare @seconds intdeclare @maxnum int-- Set number of seconds between job executionsset @seconds = 40set @maxnum = (@seconds*60)+1select top 1 NUMBER_OF_SCHEDULES_NEEDED = a.NUMBERfrom -- Number Table Function available on this link -- http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47685 F_TABLE_NUMBER_RANGE(1,@maxnum) awhere (a.NUMBER*@seconds)%60 = 0order by a.NUMBERResults:NUMBER_OF_SCHEDULES_NEEDED -------------------------- 3(1 row(s) affected) CODO ERGO SUM |
 |
|
|
|
|
|