how to inactivate trigger in sql2000?

  • Hi, good morning,

    I hope everybody is OK, bothering you about a topic. . . my question is how to inactivate a trigger in sql2000 ? is there any instruction for doing that ? I'm finding out about this because I have to do some modifications to the database and I really need the triggers don't fire.

    thanks a lot for your comments, bye !

    Amaury


    L.I. Amaury C.R.

  • This should work for you:

    ALTER TABLE table_name DISABLE TRIGGER trigger_name

    This statement should print out the commands you need to run for all active triggers in the database:

    select 'ALTER TABLE ' + b.name + ' DISABLE TRIGGER ' + a.name from sysobjects a join sysobjects b on a.parent_obj=b.id where a.type = 'tr' AND A.STATUS & 2048 = 0

    Enjoy,

    DanW

  • Hi again !

    Thanks a lot for repplying my message, this is going to be very useful for me. It's obvious that the opposite command is ENABLE TRIGGER, isn't it? . . .

    And the select is very useful too 'cause I can disable or enable or the objects I want, just a small question, I know this are bits operations, but why 2048 ?

    thanks a lot again ! ! ! = )


    L.I. Amaury C.R.

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

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