Find the Store Procedure that has the highest content

Niladri.biswas
Posted by Niladri.biswas under Sql Server category on | Points: 40 | Views : 1308
SELECT Top 1 
[Procedure Name] = OBJECT_NAME(object_id),
[Procedure Length] = LEN(Definition),
[Procedure Content In Text Mode] = Definition,
[Procedure Content In XML Mode] =
CONVERT(
XML,
(SELECT Definition As [XML_Mode]
FOR XML PATH(''))
)

FROM sys.sql_modules
WHERE OBJECTPROPERTY(object_id, 'IsProcedure')=1
ORDER BY LEN(Definition) DESC

Comments or Responses

Login to post response