DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Enabling and Disabling a Trigger in SQL

  1. #1
    Santosh Guest

    Enabling and Disabling a Trigger in SQL


    Hi All!,

    I have a trigger for update for a table (SQL server , 2 million records)
    I don't want that trigger to be fired until I wish so(ie. I want to disable
    it as in Oracle and then enable so it fires the next time).

    Is there anyway I can enable and disable a trigger in SQL , like in Oracle
    but I don't want to drop the trigger and recreate it on the fly because
    of performance issue .

    Thanks in advance.

    Santosh


  2. #2
    Robert Madrian Guest

    Re: Enabling and Disabling a Trigger in SQL

    You can use the ALTER TABLE statement to enable and disable a Trigger or all
    Triggers on that table (SQLServer 7/2000)

    ALTER TABLE [Tablename] DISABLE TRIGGER ALL.

    Robert

    "Santosh" <santosh@focusite.com> schrieb im Newsbeitrag
    news:3ac08f56$1@news.devx.com...
    >
    > Hi All!,
    >
    > I have a trigger for update for a table (SQL server , 2 million records)
    > I don't want that trigger to be fired until I wish so(ie. I want to

    disable
    > it as in Oracle and then enable so it fires the next time).
    >
    > Is there anyway I can enable and disable a trigger in SQL , like in

    Oracle
    > but I don't want to drop the trigger and recreate it on the fly because
    > of performance issue .
    >
    > Thanks in advance.
    >
    > Santosh
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center