Create Your Own User Defined Aggregate
(Ben Taylor) SQL Server ships with a number of Aggregate functions built in. These functions cover most of the normal statistical requirements by providing AVG, Checksum, Count, Sum, Min, Max, Stdev, Stdevp, Var and VarP. Microsoft has released the ability to integrate with the Group By clause in SQL Server 2005, providing the savvy developer with the ability to create their own User Defined Aggregate for those formulas that are not part of the standard set shipping with SQL Server. This article explores how this is done and defines a few aggregate functions as examples.
Read Article >>