Version: SQLServer 8
I would like to view the contents of a stored function in sqlserver, i.e. what exactly the function is doing.
None of the options listed
--ShowStoredProcedures
select p.[type]
,p.[name]
,c.[definition]
from sys.objects p
join sys.sql_modules c
on p.object_id = c.object_id
where p.[type] = 'P'
--and c.[definition] like '%foo%'
ORDER BY p.[name]
___________
SELECT OBJECT_NAME(object_id) ProcedureName,
definition
FROM sys.sql_modules
WHERE objectproperty(object_id,'IsProcedure') = 1
ORDER BY OBJECT_NAME(object_id)