User-Defined Functions
The purpose of a user-defined function (UDF) is to encapsulate logic that calculates something, pos-
sibly based on input parameters, and return a result.
SQL Server supports scalar and table-valued UDFs. Scalar UDFs return a single value; table-valued
UDFs return a table. One benefit of using UDFs is that you can incorporate them in queries. Scalar
UDFs can appear anywhere in the query where an expression that returns a single value can appear
(for example, in the SELECT list). Table UDFs can appear in the FROM clause of a query. The example
in this section is a scalar UDF.
www.it-ebooks.info
Do'stlaringiz bilan baham: |