User defined functions, known more commonly as UDFs, are routines called from T-SQL code to return either a single value or a rowset. Although they are, perhaps, the least used of specialized stored procedures, they are powerful tools in a database developer's armory. They provide the developer with the ability to create their own customized functions, which can then be re-used in other parts of their T-SQL code.
UDFs have some features that are common to stored procedures, but there are a number of restrictions as well. In this chapter, we will begin by looking at what a UDF actually is, and then move onto look at:
The different types of UDFs
Building and calling functions that return different types of data
Using schema binding with UDFs
How UDFs differ from stored procedures