The following is the top of the CLR module:
namespace CustomAggregates
{
[System.Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedAggregate(
Microsoft.SqlServer.Server.Format.Native,
IsInvariantToDuplicates = false, // receiving the same value again changes the result
IsInvariantToNulls = false, // receiving a NULL value changes the result
IsInvariantToOrder = false, // the order of the values doesn't affect the result
IsNullIfEmpty = true, // if no values are given the result is null
Name = "Median" // name of the aggregate
)]
public struct Median
{
...
When I try to add it to SQL Server, I get this message:
Msg 6556, Level 16, State 1, Line 2
CREATE AGGREGATE failed because it could not find type 'Median' in assembly 'CustomAggregates'.
Msg 6597, Level 16, State 2, Line 2
CREATE AGGREGATE failed.
Did I miss something?