CHAPTER 17

image

Table-Valued Functions

We’ve had a solid introduction to functions of the scalar kind. Now we’ll look at the other functional option provided to us by SQL Server: table-valued functions, or TVFs for short. TVFs let you create parameterized tables, which you can use in your queries to provide extra functionality that a normal join would struggle to match. Time to talk tables again!

Why TVFs Are Cool

TVFs were introduced in SQL Server 2005, and have become a widely used component of most SQL Server developers’ toolkits. I use them all the time, as they often provide the granular control needed to solve a particular problem that a view ...

Get Introducing SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.