Trigger fire sequence

  • Hi all,

    One of our tables has got 3 trigger on it.

    trigger 1,trigger 2,trigger 3

    i want to set the trigger execution sequence as

    trigger 1,trigger 3,trigger 2

    Is there any I can set the firing sequence?

    Thanks

    V

  • Would you mind to open BOL?

    Or you prefer somebody else to do it for you and copy-paste the topic here?

    _____________
    Code for TallyGenerator

  • well i am not looking for sp_settriggerorder. I have read an artical log back, don't remember where. I think the sp is called sp_triggersequence, but not sure....

  • Just open topic "Triggers" or "Create Trigger".

    It's highlighted there.

    _____________
    Code for TallyGenerator

  • I remember reading the same article (although I can't find it anymore)... it used a homegrown sp to "renumber" the ID's of the triggers so that they would fire in a certain order.  Part of the reason I can't find the article is because I summarily dismissed it as being a really, really, bad idea.... way too much at risk and if someone add's or updates another trigger, the order can easily be destroyed which will really gum up the works.

    If you want to guarantee the order between 3 triggers, use sp_settriggerorder as was implied.  If you need to control the order of more than 3 triggers, you need to just learn to incorporate trigger code into single triggers in the correct order... I don't know why people think that a trigger should only test for one thing...

    --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)

Viewing 5 posts - 1 through 5 (of 5 total)

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