I was recently engaged in a project to create some SQL Server 2005 user-defined aggregates. These would be used just like the standard set of SQL aggreates (shown below):
SELECT SUM(product_prices) FROM someProductTable
I'll write more about the project later, but suffice to say I learned a couple of things.
1. UDAs can only take one value (at this time). Of course, my project involved multi-column values.
2. If, after installing your assemblies, you then try to install your components (UDTs, UDAs, UDFs, etc.), and get the dreaded the following message:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'WeightedAverageAssembly'.
[WeightedAverageAssembly is the name of my assembly]
then check the compatibility level of your database. I found I was installing my assemblies into a database that was originally created in my old SQL Server 2000 environment.
You can modify the compatibility mode via this screen (see Compatibility level is set to SQL 2000).
