Catching a "kill job" event from within a SSIS package executed by that job.

  • I have a SQL Agent job that executes an SSIS package which includes a script task. An operator can kill the job from SSMS, and I wonder if there's a way for the script task to catch that event. I looked at all the events exposed in the SSIS designer but didn't see any that captures an externally triggered shutdown.

    If this can't be done from a script task, can it be done from another type of task? I can hack something once I get a hold of that event....

    • This topic was modified 5 years, 3 months ago by  Sam-263310. Reason: improve grammar
    • This topic was modified 5 years, 3 months ago by  Sam-263310.
  • Please ignore this question, the problem I'm having goes deeper and I already found a different solution.

    I tried to just delete this post but there seems to be no way of doing that.

    • This reply was modified 5 years, 3 months ago by  Sam-263310.
  • Thanks, Sam.  If you have the time, it would be interesting to know how you resolved the problem.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • @jeff: I didn't resolve it, it's just that as I looked into the problem further it turned out (surprise surprise...) the situation was more complicated than what the initial requirements said. Long story short: new requirements lead to some refactoring which fixed the original problem so now there's no need to manually kill the job.

    From what I could find there doesn't seem to be a way to nicely quit a package that's executed from a job when that job is killed, so in a way the original question is still open.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply