Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 drop and recreate triggers from stored procedure

Author  Topic 

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-10-04 : 21:01:24
Hi ALL,

Here is what i am thinking to write a stored procedure to do following:-

1. Drop triggers on table "A"
2. Do some processing.
3. Recreate triggers on table "A"

My problem is i dont know how to drop & recreate all triggers programmatically.

Please help me.

Thanks

mk_garg

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-10-04 : 21:15:03
You don't have to drop triggers to keep them from running:

ALTER TABLE myTable DISABLE TRIGGER ALL
... run code here ...
ALTER TABLE myTable ENABLE TRIGGER ALL

Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-10-04 : 21:30:32
great thanks


mk_garg
Go to Top of Page
   

- Advertisement -