Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

454


Part IV: Programming with T-SQL


User-defi ned functions come in three distinct types (as shown in Figure 18-1). Management
Studio groups inline table-valued functions together with multi-statement:

■ (^) Scalar functions that return a single value
■ (^) Inline table-valued functions similar to views
■ (^) Multi-statement, table-valued functions that build a result set with code
FIGURE 18-1
Management Studio’s Object Explorer lists all the user-defi ned functions within a database,
organized by table-valued and scalar-valued functions.
What’s New with UDFs in SQL Server 2012
User-defi ned functions haven’t gained any new functionality with SQL Server 2012. However, there is
one deprecated feature of table-valued functions in SQL Server 2012. The indirect application of table
hints to an invocation of a multi-statement, table-valued function through a view will be removed in a
future version of SQL Server.
c18.indd 454c18.indd 454 7/30/2012 5:41:43 PM7/30/2012 5:41:43 PM
http://www.it-ebooks.info

Free download pdf