Results 1 to 5 of 5

Thread: Disabling Triggers

  1. #1
    Join Date
    Nov 2004
    Posts
    66

    Disabling Triggers

    There is an UPDATE trigger on a table. When an update is made to a record, the trigger copies the record to another table.

    I'd like to update this table for a few records, but I do not want the trigger to be fired for just these few records. How do I do this without:

    1. Disabling the trigger, meaning all other updates will be impacted

    2. Modifying the trigger (code change)

    3. Requiring down time

    Since this is an OLTP database, I just want to make updates to a few records without firing the trigger, but I would like all other updates which occur at the same time to fire the trigger.

    Is there a command where:

    <DISABLE TRIGGER FOR QUERY BELOW ONLY>
    UPDATE Table
    SET x = y
    WHERE ID IN (1,2,3)

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Which rdbms is it on?

  3. #3
    Join Date
    Nov 2004
    Posts
    66
    Sorry... it's SQL Server 2005

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Then you can't disable trigger for specific process.

  5. #5
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    write another trigger for update that will delete all the rows from table2 for specific condition

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •