O'Reilly logo

Microsoft® SQL Server® 2008 Step by Step by Mike Hotek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving Data from a Function

You retrieve data from a function by using a SELECT statement. Functions can be used in:

  • SELECT list

  • WHERE clause

  • Expression

  • CHECK or DEFAULT constraint

  • FROM clause with the CROSS/OUTER APPLY function

How a function is used can have a dramatic impact on the performance of the queries that you execute.

A function in the SELECT list is used to calculate an aggregate or perform a computation on one or more columns from the tables in the FROM clause.

A function in the WHERE clause is used to restrict a result set based on the results of the function. You should not create queries that utilize a function in the WHERE clause, because the function has to be executed once for each row in the result set in order to determine if ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required