SqlUserDefinedAggregateAttribute Clase

Definición

Indica que el tipo debe registrarse como un agregado definido por el usuario. Las propiedades en el atributo reflejan los atributos físicos utilizados al registrarse el tipo con SQL Server. Esta clase no puede heredarse.

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
Herencia
SqlUserDefinedAggregateAttribute
Atributos

Ejemplos

En el ejemplo siguiente se muestra el atributo de un agregado definido por el SqlUserDefinedAggregateAttribute usuario. El agregado usa la serialización personalizada, tiene un tamaño máximo de 8000 bytes cuando se serializa y es invariable a valores NULL, duplicados y orden.

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

    }
}

Comentarios

SQL Server crea un agregado definido por el usuario que está enlazado a la definición de clase que tiene el SqlUserDefinedAggregateAttribute atributo personalizado. Los agregados definidos por el usuario deben anotarse con este atributo.

Vea "CLR User-Defined Aggregates" en SQL Server libros en pantalla de 2005 para obtener más información sobre los agregados y ejemplos definidos por el usuario.

Constructores

SqlUserDefinedAggregateAttribute(Format)

Atributo requerido en un agregado definido por el usuario, que se utiliza para indicar que el tipo dado es un agregado definido por el usuario y para indicar el formato de almacenamiento del agregado definido por el usuario.

Campos

MaxByteSizeValue

Tamaño máximo, en bytes, necesario para almacenar el estado de esta instancia agregada durante el cálculo.

Propiedades

Format

Formato de serialización como Format.

IsInvariantToDuplicates

Indica si el agregado es invariable a los duplicados.

IsInvariantToNulls

Indica si el agregado es invariante a los valores null.

IsInvariantToOrder

Indica si el agregado es invariante al orden.

IsNullIfEmpty

Indica si el agregado devuelve null si no se han acumulado valores.

MaxByteSize

Tamaño máximo, expresado en bytes, de la instancia del agregado.

Name

Nombre del agregado.

Se aplica a