Create continues job

  • I create daily job which will execute on every 40 minutes.

    If the lest execution is on 23 40, the next execution will be in 00 00 because

    Start of the job is on 00 00.

    Can I create continues job which will always count 40 minutes?

  • I see what you mean but a 40 min job will run 36 times a day so if you have the first run at 00:40 the last run would be at 00:00 ( which would not run as the end time would be 23:59 ) and then the next run would be 00:40 after the 23:20 run. However if you make the start time 00:20 then by my maths the job will run every 40 mins every day.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • I only gave simple example.

    It is more complex and I cannot set start time as you sugested.

    FOr example I would maybe use 39, 47 or some other time.

  • you'd need to write a scheduler I guess to do what you want. Or you could use a control job to call your other jobs at the intervals you require, your control job would run every minute and have soem logic/lookup table to know when to run each job.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Yes that is one posiblity.

    I was hopping that there is simple solution 🙂

  • I'd never given it that much thought to be honest. One extreme measure would be to create 36 individual schedules for a 40 min interval. But that would only work if the interval divided into 24 hours exactly. I don't know is the windows scheduler can do what you require - that could call a sqlcmd script to run your jobs.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • On the end I created two jobs as you sugested.

    One is executing every minut and checking the start time of other jobs and start

    them.

    It is working good.

    Thank you.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply