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
 General SQL Server Forums
 New to SQL Server Programming
 To Find the number of Table have Triggers

Author  Topic 

aantony
Starting Member

1 Post

Posted - 2009-06-15 : 11:12:34
I am a newbie here. I need a help with some basic questions. How do I find out in the whole database, the number of table have triggers. For instance, I have a database with 100 tables and I want to know the tables have triggers with it irrespective to the type of triggers. If possible, please attach SQL Statements with this..Thanks in advance...

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-06-15 : 13:01:44
2005 or greater:
select * from sys.triggers

2000:
select object_name(parent_obj), * from sysobjects where type = 'TR'

to just get a distinct list of table_names rather than the rest of the trigger attributes you can just:
select distinct object_name(parent_id) from sys.triggers

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -