You can query for object definition using sys.sql_modules catalog view in SQL 2008
Example :
SELECT OBJECT_NAME(object_id), definition FROM SYS.SQL_Modules where Definition like '
Example :
DECLARE @SearchString NVARCHAR(MAX)
SET @SearchString = 'xyz'
SELECT @SearchString, [name] , OBJECT_DEFINITION(OBJECT_ID([name]))
FROM sys.all_objects
WHERE OBJECT_DEFINITION(object_id([name])) LIKE '%' + @SearchString + '%'