Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shecduled Job Sequencing 1

Status
Not open for further replies.

cmdematos

IS-IT--Management
Mar 7, 2001
29
US
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.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top