Share via


EventClass.EventChronicleRule Property

Gets the EventChronicleRule for the event class.

Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintaxis

'Declaración
Public Property EventChronicleRule As EventChronicleRule
public EventChronicleRule EventChronicleRule { get; set; }
public:
property EventChronicleRule^ EventChronicleRule {
    EventChronicleRule^ get ();
    void set (EventChronicleRule^ value);
}
/** @property */
public EventChronicleRule get_EventChronicleRule ()

/** @property */
public void set_EventChronicleRule (EventChronicleRule value)
public function get EventChronicleRule () : EventChronicleRule

public function set EventChronicleRule (value : EventChronicleRule)

Valor de propiedad

The EventChronicleRule for the event class.

Notas

If the event class has EventChronicles, you must define an EventChronicleRule. The chronicle rule contains the Transact-SQL queries that maintain the data in the event chronicle tables.

Ejemplo

The following examples show how to define an event chronicle rule and then assign it to an event class:

// Define the event chronicle rule
EventChronicleRule ec1Rule = 
    new EventChronicleRule(flightEvents, 
    "FlightEventChronicleRule");
ec1Rule.Action = "INSERT MyAppSchema.FlightEventChronicle " + 
    " (LeavingFrom, GoingTo, Price) " + 
    " SELECT LeavingFrom, GoingTo, Price " + 
    " FROM MyAppSchema.FlightEvents;";
ec1Rule.ActionTimeout = new TimeSpan(0, 1, 20);
flightEvents.EventChronicleRule = ec1Rule;
' Define the event chronicle rule
Dim ec1Rule As EventChronicleRule = _
    New EventChronicleRule(flightEvents, _
        "FlightEventChronicleRule")
ec1Rule.Action = _
    "INSERT MyAppSchema.FlightEventChronicle " + _
    " (LeavingFrom, GoingTo, Price) " + _
    " SELECT LeavingFrom, GoingTo, Price " + _
    " FROM MyAppSchema.FlightEvents;"
ec1Rule.ActionTimeout = New TimeSpan(0, 1, 20)
flightEvents.EventChronicleRule = ec1Rule

Seguridad para subprocesos

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

EventClass Class
EventClass Members
Microsoft.SqlServer.Management.Nmo Namespace

Otros recursos

ChronicleRule Element (ADF)
Definir reglas de crónica de eventos