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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find all triggers on a database

Status
Not open for further replies.

riksweeney

Programmer
Nov 4, 2002
17
0
0
GB
Hopefully this one will be nice and easy:

How do I find all the triggers that exist on a database? Is is possible to write a SELECT statement to do it?

Thanks

Richard Sweeney
 
Code:
USE db_name

SELECT * FROM sysobjects
WHERE xtype = 'tr'

--James
 
Also, this one will give you the table names as well:

Code:
SELECT o.name AS triggername, p.name AS tablename
FROM sysobjects o JOIN sysobjects p ON o.parent_obj = p.id
WHERE o.xtype = 'tr'

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top