hytfaq
Last Updated: February 25, 2016
·
55.99K
· getsetcode

Find all objects containing specific text in SQL Server

Want to find all T-SQL objects which reference a particular table name, column name, stored procedure?

SELECT DISTINCT a.[name]
FROM sysobjects a
INNER JOIN syscomments b on a.id = b.id
WHERE b.[text] LIKE '%[search-term]%'