• amartha_dutta (1/21/2009)


    To disable / enable selective triggers...

    ALTER TABLE tableName DISABLE TRIGGER triggername

    ALTER TABLE tableName ENABLE TRIGGER triggername

    To disable / enable all triggers...

    ALTER TABLE tableName DISABLE TRIGGER ALL

    ALTER TABLE tableName ENABLE TRIGGER ALL

    Use this with caution and ensure proper handling as a transaction might have disabled but an error in the script might fail to enable it back.

    Happy SQLing...

    Heh... and the OP actually misses the opportunity to use Books Online for the first time in their life. 😉

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