O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

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

Summary

User-defined functions in SQL Server 2012 allow you to create reusable routines that can help make your SQL code more straightforward and efficient.

In this chapter, you saw how to create and modify scalar functions and inline and multistatement table-valued functions and how to invoke and use them in queries. Scalar functions can be used to perform more complex operations than those provided by the built-in scalar functions. Table-valued functions provide a way to create what are essentially parameterized views, and you can include them inline in your queries, just as you would in a table or view.

With the introduction of CLR-based functions, SQL Server 2012 greatly increases the power and capabilities of user-defined functions, and ...

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