I want to run a stored procedure as a scheduled job quite frequently (say about every two minutes). Under certain conditions this SP may take more than two minutes to run. Will the system kick off two stored procedures under these circumstances?
I have a similar situation. What I do is use a “status” table to keep track of what is running & Utilize two SP’s. For example:
Sched SP_A to run every two minutes
SP_A checks the status table to see if SP_B is running. If not, run SP_B
SP_B starts by turning indicator on in the status table. It turns ind. off when it is finished.
Sounds involved but really isn’t If the PK of the status table is the SP name it can be used for many different tasks. SP_A could take in the name of the procedure to run as an argument.
I took this one step further by adding a trigger to the status table to keep a history. Rows are inserted into a history table that tell me when the procedure ran, how long it took, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.