Saturday, March 5, 2011

Quickly Find the Triggers and Stored Procedures For a Table in Database

A very warm welcome you to my personal Web development blog.

Here's a smart trick to quickly fetch all the triggers and stored procedures associated with a particular table in the database.

Query:

SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%Table_Name%'


Just replace your table name in the query and execute it.