0

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?

Metaphor
  • 6,157
  • 10
  • 54
  • 77
  • Sounds like this question on use defined aggregates. http://stackoverflow.com/questions/9470150/create-assembly-in-sqlclr-using-assembly-byte-string-failed-because-it-could-not – Richard Vivian May 19 '14 at 16:22
  • It isn't - the physical file is found but the type "Median" within is is not. – Metaphor May 19 '14 at 17:28

0 Answers0