There are three types of UDF
- Scalar function
- In-line function
- Multi-statement functions.
Sclare Function
Scalar
UDFs return a single value. They are similar to built-in functions such as
DB_NAME(), GETDATE(), or USER_ID(), which return a single string, date, or
integer
Inline Function
In-line UDFs return a single row or multiple rows and can contain a single SELECT statement. Because in-line UDFs are limited to a single SELECT, they can't contain much logic
Multi-Statement Function
Multi-statement UDFs can contain any number of statements that populate the table variable to be returned. Notice that although you can use INSERT, UPDATE, and DELETE statements against the table variable being returned, a function cannot modify data in permanent tables
Comments
Post a Comment