Find all the SP using specific tables or views
April 14, 2009
Feedback's a good way to encourage author even if it's a criticize. It's proved you care about the article. Please, leave a comment to let everyone know what you think about this post.
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

Leave a Reply