DECLARE @codesnippet varchar(100);
SET @codesnippet = 'EnterStringHere';
SELECT
O.type_desc AS ObjectType,
(LEFT(OBJECT_NAME(M.[object_id]), 50)) AS ObjectName
FROM
sys.sql_modules M
JOIN
sys.objects O ON M.[object_id] = O.[object_id]
WHERE
definition LIKE '%' + @codesnippet + '%'
AND
OBJECTPROPERTY(M.[object_id], 'IsMSShipped') = 0
ORDER BY
ObjectName;