User-defined functions are a class of procedures that return
a single value to the calling environment. This section introduces
creating, using, and dropping user-defined functions.
Creating User-Defined Functions
You use the CREATE FUNCTION statement to create user-defined functions. However, you must have RESOURCE authority.
Calling User-Defined Functions
A user-defined function can be used, subject to permissions, in any place you would use a built-in nonaggregate function.
Dropping User-Defined Functions
Once a user-defined function is created, it remains in the database until it is explicitly removed.