Find the Table Function that has the highest content

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

)

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

Comments or Responses

Posted by: Self-innovator on: 12/23/2011 Level:Bronze | Status: [Member] | Points: 10
Great..

Login to post response