Last Updated: February 25, 2016
·
101.7K
· 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]%'