How to disable only related triggers

  • Hi,

    I want to disable triggers which I found using this .

    select text from syscomments

    where text like '%GLPaudit%'

    Thanks,

    -V

  • disable trigger "full name of trigger"

    on "object" --this can be a table/database/server etc

    you can also disable a DML trigger using the following

    alter table "your table"

    disable trigger "full name of trigger"

  • Hi,

    I wanted to know disable all triggers at once, which had text like GLPAudit, not individually. Using dynamic sql it may be possible I guess..But I don't know much dynamic sql...

    Thanks,

    -V

  • you could run the following query into a temp table and then loop through it disabling the triggers one at a time

    select name,parent_id from sys.triggers where name like '%GLPAudit%'

    From the parent_id you can do object_name('object') to get the name of the table to put in your alter table statement.

  • Hi,

    How to find triggers assosiated with a table ?

    Thanks again..

    -V

  • select name from sys.triggers where parentid = object_id('yourtable')

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

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