Find all the SP using specific tables or views
April 14, 2009
Find in the database all the store procedures using specific tables or views.
Or list all the tables or view, which the specific Views or StoreProcudres use.
EXEC sp_depends @objname='tablename'
Sometime you want to check to see if any StoreProcedures or Views is using specific Views or StoreProcedures
SELECT DISTINCT o.name, o.xtype FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id WHERE c.TEXT LIKE '%tablename%'
Referece from:
Find Stored Procedure Related to Table in Database – Search in All Stored Procedure
I didn’t know about the “EXEC sp_depends @objname=’tablename’ ”
awesome.
Trackbacks