As Chapter 5, Data Exploration and Statistics with T-SQL described, SQL Server provides a rich set of very feasible built-in aggregate functions to fulfill our statistical needs. However, for deeper insight into our data, the list of built-in functions could be insufficient. This section is a walkthrough example of how to create our own custom aggregation using C# and the CLR aggregate SQL Server object.
Creating CLR aggregations
Example goal and assignment
In Chapter 5, Data Exploration and Statistics with T-SQL, we learned about variance as well as the rate of parameter scattering. Let's revisit the following formula:
We can generalize the preceding formula. If we replace the power of 2 with (almost) any number, k...