SQL Server 2005 has great sys.XXX
views on the system catalog which I use frequently.
What stumbles me is this: why is there a sys.procedures
For a fuller description of scalar functions including owner and return type:
SELECT f.name, s.name AS owner, t.name as dataType, p.max_length, p.precision, p.scale, m.definition
FROM sys.objects f
JOIN sys.schemas s on s.schema_id = f.schema_id
JOIN sys.parameters p on p.object_id = f.object_id AND p.parameter_id = 0
JOIN sys.types t ON t.system_type_id = p.system_type_id
JOIN sys.sql_modules as m ON m.object_id = f.object_id
WHERE type='FN';
It's very slightly more verbose, but this should do exactly the same thing:
select * from sys.objects where (type='TF' or type='FN')
As far as I can see, it's not in SQL Server 2008 either.
SQL 2000
specific, slight adjustment for the object name:
SELECT *
FROM sysobjects
WHERE type IN ('FN', 'IF', 'TF')
OR
SELECT *
FROM dbo.sysobjects
WHERE type IN ('FN', 'IF', 'TF')
This is valid in 2008 R2 per what SSMS generates when you script a DROP of a function:
SELECT *
FROM sys.objects
WHERE type IN (N'FN', N'IF', N'TF', N'FS', N'FT') ;
/*
From http://msdn.microsoft.com/en-us/library/ms177596.aspx:
FN SQL_SCALAR_FUNCTION
FS Assembly (CLR) scalar-function
FT Assembly (CLR) table-valued function
IF SQL_INLINE_TABLE_VALUED_FUNCTION
TF SQL_TABLE_VALUED_FUNCTION
*/