Microsoft® SQL Server 2012 Unleashed
by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access