Timer for executing Stored Procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Subodh

    #1

    Timer for executing Stored Procedure

    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,

    Subodh
  • Anith Sen

    #2
    Re: Timer for executing Stored Procedure

    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 )


    Comment

    • Subodh Goyal

      #3
      Re: Timer for executing Stored Procedure

      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 ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...