A highly specialized feature of SQL Server 2008, managed user-defined aggregates (UDAs) provide the capability to aggregate column data based on user-defined criteria built in to .NET code. You can now extend the (somewhat small) list of aggregate functions usable inside SQL Server to include those you custom-define.
If you’ve been following the examples in this chapter sequentially, at this point, you need to drop the sample table
dbo.RegexTest to redeploy the assembly after creating the UDA example.
The implementation contract for a UDA requires the following:
• A static method called
Init(), used to initialize any data fields in the struct, particularly the field that contains the aggregated ...