SELECT OBJECT_NAME(object_id),
definition
FROM sys.sql_modules
WHERE objectproperty(object_id,'IsProcedure') = 1
AND definition like '%Foo%'
SELECT OBJECT_NAME(object_id),
definition
FROM sys.sql_modules
WHERE objectproperty(object_id,'IsProcedure') = 1
AND definition like '%Foo%'