Find the Scalar Function that has the highest content

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

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

Comments or Responses

Login to post response