METHOD-1:
SELECT SO.name AS [ProcName],SC.text AS [Text] FROM SYS.OBJECTS SO
JOIN SYSCOMMENTS SC ON SO.object_id=SC.id
WHERE TYPE='P' and [text] like '%SearchValue%'
METHOD-2:
SELECT name AS [ProcName],OBJECT_DEFINITION(object_id) AS [Text] FROM
SYS.OBJECTS WHERE TYPE='P'
AND OBJECT_DEFINITION(object_id) LIKE '%SearchValue%'
Really Nice one.. Thanks for sharing ... :)
ReplyDelete