From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

SQL Server function overview

SQL Server function overview

- [Narrator] SQL Server supports the creation of user-defined functions that accept parameters, perform some actions or calculations, and then returns the result of the action. There are a number of reasons that user-defined functions, or UDFs, benefit a well-designed SQL Server database. First, they enable the database designer to implement modular programming. Create the function one time and then you can call it from a number of other functions and routines. This makes it easy to update the function and have that update be instantly available throughout the database. Second, they're efficient. SQL Server will cache the execution plan used for a user-defined function so that it can be reused the next time it's called. Finally, they can reduce network traffic by encompassing complex filtering criteria that is processed on the server before the results are sent to the client. Like views, functions can be SCHEMA-bound.…

Contents