Quick tip: Search for a term in a Stored Procedure

Need to find out if a term is referenced in any stored procedures in your database?  Use the following T-SQL statement…

select name, definition   
from sys.procedures p  
inner join sys.sql_modules m   
on p.object_id = m.object_id  
where m.definition like '%search term%';

This will work in SQL Server 2005 and 2008.