O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

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

Types of User-Defined Functions According to Their Return Value

You can define a user-defined function with a single statement or with multiple statements, as you will see later in this chapter in the "Creating and Dropping User-Defined Functions" section.

According to their return value, user-defined functions can be divided into three groups:

  • Scalar functions that return a single scalar value.

  • Table-valued functions that return a full result set, similar to a table.

  • Inline user-defined functions are a special case of table-valued user-defined functions, but they are limited to a single SELECT statement.

Scalar Functions

Scalar user-defined functions return a single value, and they can be used wherever an expression is accepted, such as

  • In the ...

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