Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to view all triggers in a db

Status
Not open for further replies.

IanStrange

Programmer
Sep 16, 2002
36
GB
Hi
I am looking for a way to see all the triggers currently on every table in one database.
Is there some bdcc I can use or clever select statement on one of the system tables.
Thanks
Ian

No man is an island but 6 tied together make quite a good raft.
 
Either the undocumented SP sp_msforeachtable or query the sysobjects table:

Code:
EXEC sp_msforeachtable 'EXEC sp_helptrigger [?]'

select tbl.name as table_name, tr.name as trigger_name
from sysobjects tr join sysobjects tbl on tr.parent_obj = tbl.id
where tr.type = 'tr'
order by tbl.name

--James
 
Thanks very much exactly what I needed.

No man is an island but 6 tied together make quite a good raft.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top