Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010

    Unanswered: killing a Job/SP

    here is my situation: I have a job that executes a SP that updates a column(Image data type). so this job can only run for 2 hiurs and it should be killed because i don't want it to run while the table is been used by the business. how do i automatically kill this job/SP after it has run for 2 hours?

  2. #2
    Join Date
    Aug 2004
    Dallas, Texas
    Use the kill T-SQL function.

  3. #3
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    but if you have a single transaction running for 2 hours it might take 2 hours to rollback. the better questions would be why is your job running for 2 hours and why would you not care if it completed or was rolled back?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Jan 2007
    Provided Answers: 12
    Thrasy is right. Identify why it's taking so long, don't just stick your thumb in the dyke, repair the problem properly.

    Consider batching up your updates. Then having a check upon each invocation based on the time and if it exceeds a defined limit, do not proceed with further updates. Obviously you want to ensure that items at the "end" of the batch process get hit next time, rather than just updating the same N batches each run.
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts