SqlUserDefinedAggregateAttribute 類別

定義

指示型別應該註冊為使用者定義彙總 (Aggregate)。 該屬性 (Attribute) 上的屬性 (Property) 反映使用 SQL Server 註冊型別時使用的實體屬性 (Attribute)。 此類別無法獲得繼承。

public ref class SqlUserDefinedAggregateAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed class SqlUserDefinedAggregateAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)>]
type SqlUserDefinedAggregateAttribute = class
    inherit Attribute
Public NotInheritable Class SqlUserDefinedAggregateAttribute
Inherits Attribute
繼承
SqlUserDefinedAggregateAttribute
屬性

範例

下列範例顯示 SqlUserDefinedAggregateAttribute 使用者定義匯總的屬性。 匯總會使用自定義串行化、串行化時的大小上限為8000個字節,且不因Null、重複和順序而異。

using Microsoft.SqlServer.Server;
using System.IO;
using System.Data.Sql;
using System.Data.SqlTypes;
using System.Text;

[Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedAggregate(
   Microsoft.SqlServer.Server.Format.UserDefined,
   IsInvariantToNulls = true,
   IsInvariantToDuplicates = false,
   IsInvariantToOrder = false,
   MaxByteSize = 8000)
        ]
public class Concatenate : Microsoft.SqlServer.Server.IBinarySerialize
{

    public void Read(BinaryReader r)
    {

    }

    public void Write(BinaryWriter w)
    {

    }
}

備註

SQL Server 會建立系結至具有SqlUserDefinedAggregateAttribute自定義屬性之類別定義的使用者定義匯總。 每個使用者定義彙總都必須使用這個屬性加註。

See "CLR User-Defined Aggregates" in SQL Server 2005 Books Online for more information on user-defined aggregates and examples.

建構函式

SqlUserDefinedAggregateAttribute(Format)

使用者定義彙總上的必要屬性,用於指出指定型別是使用者定義彙總,以及使用者定義彙總的儲存格式。

欄位

MaxByteSizeValue

在計算期間儲存此彙總執行個體之狀態所需的大小上限 (以位元組為單位)。

屬性

Format

做為 Format 的序列化格式。

IsInvariantToDuplicates

指出彙總是否不因重複項目而異。

IsInvariantToNulls

指出彙總是否不因 null 項目而異。

IsInvariantToOrder

指出彙總是否不因順序而異。

IsNullIfEmpty

指出未累積值時,彙總是否傳回 null

MaxByteSize

彙總執行個體的最大大小 (以位元組為單位)。

Name

彙總的名稱。

適用於