Understanding User-defined Functions
SQL Server 2005
Like functions in programming languages, Microsoft SQL Server 2005 user-defined functions are routines that accept parameters, perform an action, such as a complex calculation, and return the result of that action as a value. The return value can either be a single scalar value or a result set.