How to find where a table is referenced?

When you need to find all procedures and function referencing a particular table then use following:

FROM syscomments c JOIN sysobjects o ON = JOIN INFORMATION_SCHEMA.Tables t ON c.text LIKE '%'+t.TABLE_NAME+'%'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.