schedule job


Please assist how can we resolve the error poping up when i apply, Error 14266: the specified '@active_end_tme' is invalid (valid values are: before or after @active_start_time) job was not saved.

I wanted to schdule the job for 23:59:59 daily.

what I did was,

Every 1 day

Daily frequency:
Occurs once at 23:59:59

Who is Participating?
Aneesh RetnakaranDatabase AdministratorCommented:
Yes , that's true, If you want that thing, you can handle this at the  your procedure or Query itself. you can write a query to fetch the contents b/w 00000 and 235959 of the previous day and schedule the job at  '00000'

Otherwise you have to use the 2nd option i have mentioned in my first post
Aneesh RetnakaranDatabase AdministratorCommented:
You can handle this is 2 ways
1. change the start time to 235958
2. Change the schedule not the time
select the  "occurs once at " option (the first one in the daily frequency section). It will run once a day (or at whatever interval you have set or want set in the Occurs section) at 11:59:59 PM.
RyanBankAuthor Commented:

i did exactly the same using number 2. this is how i got the error. it works for 23:59:58 but doesn't for 23:59:59...

how do we normally schedule ?
Aneesh RetnakaranDatabase AdministratorCommented:
The same thing happened to me also, So when i generated the script for the job, i found that the @active_end_tme' is set as 235959 which is the endof the day (remember the variable will be in the format 'HHMMSS'). This is because you schedule it to run on daily basis, so your start time and end time will be the same, Since it is a routine, it has to finish @ 235959...
So in order to run on a daily basis you need to reduce the time by 1 second, so that the job can run for at least one second

Hope you got the idea
RyanBankAuthor Commented:
wont we loose 1 second of data? if we set it to 23:59:58

23:59:59 data's
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.