Writing UDFs as SQL functions
An SQL function is a user-defined function (UDF) that you define, write, and register using the CREATE FUNCTION statement.
An SQL function is written only in the SQL language and its definition is completely contained within one potentially large CREATE FUNCTION statement. The creation of an SQL function causes the registration of the UDF, generates the executable code for the function, and defines to the database the details of how parameters are passed.
- Example: SQL scalar UDFs
This example shows a scalar function that returns a priority based on a date.
- Example: SQL table UDFs
This example shows a table function that returns data based on a date.
Parent topic:
Using user-defined functions