Introduction: In this short article I am going to share sql
server commands/statements to get or check all user defined functions i.e.
the functions created by us rather than in-built functions.
In previous article i explained How to find all or any Sql Server Table,View,Stored Procedure and Schema and 20 main differences between Stored procedures and Functions in Sql Server and Create, check and drop FOREIGN KEY CONSTRAINT and Check PRIMARY, FOREIGN, UNIQUE KEY CONSTRAINTS and Create table in sql server with auto increment primary key column
Description: I have mentioned 3 statements/commands through
which you can check all the user defined functions created under a database.
Implementation: Let’s find
the UDF’s with any of the 3 commands mentioned below. On executing any of these commands you
will get list of all the user defined functions created.
Command 1
SELECT * FROM sys.objects WHERE RIGHT(type_desc,8)='FUNCTION'
SELECT name as [Function Name],SCHEMA_NAME(schema_id) as [Schema Name] FROM sys.objects WHERE RIGHT(type_desc,8)='FUNCTION'
Command 2
SELECT * FROM sys.objects WHERE
type_desc LIKE '%FUNCTION%'
SELECT name as [Function Name],SCHEMA_NAME(schema_id) as [Schema Name] FROM sys.objects WHERE type_desc LIKE '%FUNCTION%'
Command 3
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE
ROUTINE_TYPE='FUNCTION'
SELECT SPECIFIC_NAME as [Function Name], SPECIFIC_SCHEMA AS
[Schema Name] FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE='FUNCTION'
Now over to you:
If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..