all groups > sql server (alternate) > july 2003 >
You're in the

sql server (alternate)

group:

Timer for executing Stored Procedure


Timer for executing Stored Procedure sgoyal NO[at]SPAM triversity.com
7/11/2003 7:06:34 AM
sql server (alternate): HI,

I need to run same kind of transactions (basically deleting records)
in a loop but I have only 1 hour in a day to run my procedure. So I
need to set a timer in a SP so that SP terminates after one hour and
then rest of the transactions will be done next day.
Can anybody suggest as how to check execution time in a stored
procedure? The execution of the SP will be scheduled every night.
If u need any further info pls ask.

Thanks,

Re: Timer for executing Stored Procedure Anith Sen
7/11/2003 3:22:19 PM
I am not sure if you are on the right track. What will you do after an hour?
Abruptly terminate the stored procedure? What happens to the uncommitted
transactions? A more reliable way of doing this is to do it in smaller
batches. Perhaps set up the procedure to run as a job from the scheduler.

--
- Anith
( Please reply to newsgroups only )

Re: Timer for executing Stored Procedure Subodh Goyal
7/11/2003 3:57:34 PM
The deletion of records will be done in small chunks. I'll allow the
current transaction to commit but will not allow the new transaction to
begin after one hour. once my currnet tansaction is over I want to stop
executing the SP. Next day agin same SP will be executed in a job.
The thing is there r 290 million records to be deleated which cann't be
done in one go.

Thanks,

Subodh



*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button