Reputation: 15
Basically I want to call a stored procedure with two dates as Parameters.
The first date is a date on which I want to perform a set of tasks, and on the second date I want to undo these.
I'm managing some Users in my system and want to give them the option to set a replacement person for theirs task for when they are on holidays.
For this to work on my system I have to assign the replacements ID to the tasks of the person they are replacing for the given time frame.
Meaning switch all IDs date where person goes on holiday, and then switch them back once the person is back.
I'm not sure how to schedule this, all scheduling things I've seen so far are rigid once a week, once a day things.
I don't know how to call a procedure and specify the date on which it should be executed.
Upvotes: 0
Views: 329
Reputation: 6212
Run this procedure as a once-a-day SQL Agent job, but the procedure should pick up its "switch user" dates from a table, not from its parameter list.
This design would ensure that you could switch as many users as you like at whatever intervals without changing any aspect of the deployed software, or job scheduling.
Upvotes: 1