How to find where a table is referenced?
By ziqbalbh
When you need to find all procedures and function referencing a particular table then use following
SELECT o.name, t.TABLE_NAME, c.text
FROM syscomments c JOIN sysobjects o ON c.id = o.id JOIN INFORMATION_SCHEMA.Tables t ON c.text LIKE '%'+t.TABLE_NAME+'%'
This entry was posted on February 9, 2007 at 11:24 am and is filed under SQL Server. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.