Blog By Hal Hayes
Friday, March 09, 2007

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).

 

3/9/2007 2:28:17 AM (Eastern Standard Time, UTC-05:00) |  | .NET Framework 2.0 | SQL Server 2005 | Visual Studio 2005#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll
 CTO 2.0
Antonio Chagoury
Dot NET Ramblings
Brian Noyes
 New Entry
 SharePoint Resources
Lamont Harrington
 Winsmarts
Sahil Malik
Themes
Pick a theme: