© Lisa Bohm 2020
L. BohmRefactoring Legacy T-SQL for Improved Performancehttps://doi.org/10.1007/978-1-4842-5581-0_7

7. Functions

Lisa Bohm1 
(1)
Chardon, OH, USA
 

Functions can come in a couple of flavors. There are table-valued functions, in which you can pass in one or a group of values and get a table of values in return. There are also scalar-valued functions, in which you pass in one or a group of values and get a single return value.

Aggregate functions are functions that operate on a group of values to return a single value. There are several built-in functions of SQL Server that perform aggregation: COUNT(), MIN(), MAX(), SUM(), and others. All of these, with the exception of COUNT(), ignore NULL values. You may also create your own user-defined ...

Get Refactoring Legacy T-SQL for Improved Performance: Modern Practices for SQL Server Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.