Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Example: You need the average price of all the products in the products table. The AVG built-in function can be used in a SELECT statement to calculate and retrieve the average price. SQL Server provides a rich set of built-in functions in several different categories. Use existing built-in functions instead of creating your own.
Can be accessed in a SELECT statement or a VIEW.
Different functions accept varying input.
Output can be scalar (single value) or a result set that can be used as a derived table.
BOL topic “Functions (Transact-SQL)” has a category listing of built-in functions. Two examples are:
String functions can be used to manipulate character data such as LTRIM to remove leading spaces.
Date functions can be used to retrieve or manipulate dates such as GetDate() to get the current date.