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 2005 Forums
 Transact-SQL (2005)
 Query system tables for triggers

Author  Topic 

abonslater
Starting Member

2 Posts

Posted - 2008-04-24 : 17:45:17
Hello,

I am trying to create a stored procedure that will disable triggers on any given table. Basically I want to pass in a table name as a parameter and query the master table for all triggers that belong to that table...then disable them. I just don't know how to get a list of triggers that belong to a table?

Thanks,
Andrew

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-24 : 17:58:42
You don't need a list of the triggers to be able to disable them. Just run ALTER TABLE DISABLE TRIGGER ALL. Check BOL for details.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

abonslater
Starting Member

2 Posts

Posted - 2008-04-24 : 18:17:23
I don't know why I didn't think of that. Thanks a lot Tara!!!

quote:
Originally posted by tkizer

You don't need a list of the triggers to be able to disable them. Just run ALTER TABLE DISABLE TRIGGER ALL. Check BOL for details.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Go to Top of Page
   

- Advertisement -