Wednesday, November 16, 2011

How to listout the Functions in the database?


Method 1 : SELECT name FROM SYS.OBJECTS WHERE type=’IF’ — inline function
Method 2 : SELECT name FROM SYS.OBJECTS WHERE type=’TF’ — table valued function
Method 3 : SELECT name FROM SYS.OBJECTS WHERE type=’FN’ — scalar function
Method 4 : SELECT name FROM SYS.ALL_OBJECTS WHERE type=’IF’ — inline function
Method 5 : SELECT name FROM SYS.ALL_OBJECTS WHERE type=’TF’ — table valued function
Method 6 : SELECT name FROM SYS.ALL_OBJECTS WHERE type=’FN’ — scalar function
Method 7 : SELECT Routine_name FROM INFORMATION_SCHEMA.ROUTINES WHERE
ROUTINE_TYPE=’FUNCTION’
Note: IF – Inlined Function, TF- Table valued function, FN- Scalar Function