O'Reilly logo

Introducing SQL Server by Mike McQuillan

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

CHAPTER 16

image

Functions

Functions were introduced in SQL Server 2000 and made an immediate impact. Functions allow you to wrap up pieces of code you use all the time into a nice, compact, reusable package. In this chapter, we’ll find out what types of function SQL Server allows us to create, why functions are useful, and how we can improve our code with functions. We’ll also see some of the system functions SQL Server provides. By the end of this chapter, we’ll know all about scalar functions, and we’ll be ready to talk about table-valued functions (TVFs) in Chapter 17. We’ll be half-functional!

Function Types

Broadly speaking, there are two types ...

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