Quackit Logo

FREE Hosting!

With every domain name you register with ZappyHost, you get FREE hosting.

$1.99 Domain Names

With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.

SQL Functions

Print Version

SQL has a number of functions to assist you in your database programming.

Functions are a self contained script/program built for a specific purpose. Generally, the value returned by a function will depend on the context in which it is being used. Often, a SQL function will be used within a query and this is what provides it with it's context.

Transact-SQL provides 3 different types of functions:

Rowset FunctionsThese return an object that can be used in place of a table reference in a SQL statement
Aggregate Functions Perform a calculation on a set of values and return a single value. Aggregate functions can be used in the following:
  • The select list of a SELECT statement
  • A COMPUTE or COMPUTE BY clause
  • A HAVING clause
Scalar Functions These return a single value from a single value. Scalar functions are categorized as follows:
  • Configuration Functions
  • Cursor Functions
  • Date and Time Functions
  • Mathematical Functions
  • Metadata Functions
  • Security Functions
  • String Functions
  • System Functions
  • System Statistical Functions
  • Text and Image Functions

On top of these functions, different database vendors have their own built-in functions for their products. Also, most products enable programmers to program their own User Defined Functions. For information on proprietary functions, you should consult the vendor's documentation.

In the next lesson you will learn about one of the more commonly used SQL functions - the COUNT function.

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
               
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!