How to find the name of stored procedure, based on table name search, using SQL Server 2008?

Viewed 94894

I want to find all of the stored procedures where a particular table is being used. There are lots of stored procedures in the database, so it's not feasible to check each procedure.

Is there any way to use a search query so that I can find the stored procedures?

I have tried this code:

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

Where RejectionReason is my table name, but it shows all procedures where RejectionReason is used as column name, so that doesn't work.

9 Answers
Related