views:

42

answers:

3

Something like:

SELECT * FROM sys.functions
+2  A: 

Something like this will give you all the details of the udfs you've created.

SELECT *
    FROM
        sysobjects
    WHERE
        (type = 'TF' OR type = 'FN' OR type = 'IF')
        AND
        objectproperty(id, 'IsMSShipped') = 0

Get rid of the second condition if you want everything.

jammus
A: 

This will give you the names and the definitions :

SELECT SPECIFIC_NAME, ROUTINE_DEFINITION
    FROM INFORMATION_SCHEMA.ROUTINES 
WHERE ROUTINE_TYPE = 'FUNCTION'
Mongus Pong
ROUTINE_DEFINITION is not reliable. It's only nvarchar(4000), actual def is nvarchar(max)
gbn
+3  A: 

for SQLServer2005 it is:

SELECT * 
    FROM sys.objects 
    WHERE type in ('TF','FN','IF')
JBrooks
+1 for correct use of new system views
gbn
+1 for the 'in' and not or or
Shimmy