Benefits of User-Defined Functions
You learned in Chapter 8, "Implementing Business Logic: Programming Stored Procedures," how to create stored procedures, which are similar to the way you create functions in other programming languages. However, using stored procedures from Transact-SQL is not very flexible, because you can use them only with the EXECUTE or INSERT...EXECUTE statements. If you have a stored procedure that returns a single value, you cannot use this procedure inside an expression. If your procedure returns a result set, you cannot use this procedure in the FROM clause of any Transact-SQL statement.
In Chapter 3, "Working with Tables and Views," you learned about views and how to use them anywhere as a replacement for tables. ...
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