There are three types of User-Defined functions in SQL Server 2000 and they are Scalar, Inline Table-Valued and Multi-statement Table-valued.
Scalar UserDefined Function.
A Scalar userdefined function returns one of the scalar data types. Text, ntext, image and timestamp data types are not
supported. These are the type of userdefined functions that most developers are used to in other programming languages.
You pass in 0 to many parameters and you get a return value.
Inline Table-Value User-Defined Function
It returns a table data type and is an exceptional alternative to a view as the userdefined function can pass parameters
into a SQL select command and in essence provide us with a parameterized, nonupdateable view of the underlying tables.
Multi-statement Table-Value User-Defined Function
A MultiStatement TableValue userdefined function returns a table and is also an exceptional alternative to a view as
the function can support multipleSQL statements to build the final result where the view is limited to a single SELECT
statement. Also, the ability to passparameters into a TSQL select command or a group of them gives us the capability to
in essence create a paameterized, noupdateable view of the data in the underlying tables. Within the create function
command you must define the table structure that is being returned. After creating this type of userdefined function,
It can be used in the FROM clause of a TSQL command unlike the behavior found when using a stored procedure which
can also return record sets.