Condividi tramite


EventClass.EventChronicles Property

Gets the EventChronicleCollection for the EventClass.

Spazio dei nomi: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property EventChronicles As EventChronicleCollection
public EventChronicleCollection EventChronicles { get; }
public:
property EventChronicleCollection^ EventChronicles {
    EventChronicleCollection^ get ();
}
/** @property */
public EventChronicleCollection get_EventChronicles ()
public function get EventChronicles () : EventChronicleCollection

Valore proprietà

The EventChronicleCollection for the event class.

Osservazioni

Event chronicles are optional.

Event chronicles provide supplemental storage for event data. One common use for event chronicles is to maintain event data for use by scheduled rules.

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.

If you add or delete event chronicles, updating the application deletes and re-creates the event class to which it corresponds. This includes dropping and re-creating the Microsoft SQL Server tables and indexes used by this event class. Any data in the existing event tables is permanently deleted.

Esempio

The following examples show how to define an event chronicle and the add it to the collection of chronicles for the event class:

// Define a chronicle for the class
EventChronicle ec1 = 
    new EventChronicle(flightEvents, "FlightEventChonicle");
ec1.SqlStatements.Add(
    "CREATE TABLE MyAppSchema.FlightEventChronicle " + 
    " (LeavingFrom nvarchar(6), GoingTo nvarchar(6), " +  
    " Price float);");
ec1.SqlStatements.Add(
    "CREATE INDEX FlightEventChronicleIndex  " + 
    "ON MyAppSchema.FlightEventChronicle " + 
    "( LeavingFrom, GoingTo );");
flightEvents.EventChronicles.Add(ec1);
' Define a chronicle for the class.
Dim ec1 As EventChronicle = _
    New EventChronicle(flightEvents, "FlightEventChonicle")
ec1.SqlStatements.Add( _
    "CREATE TABLE MyAppSchema.FlightEventChronicle " + _
    " (LeavingFrom nvarchar(6), GoingTo nvarchar(6), " + _
    " Price float);")
ec1.SqlStatements.Add( _
    "CREATE INDEX FlightEventChronicleIndex " + _
    "ON MyAppSchema.FlightEventChronicle " + _
    "( LeavingFrom, GoingTo );")
flightEvents.EventChronicles.Add(ec1)

Thread Safety

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

EventClass Class
EventClass Members
Microsoft.SqlServer.Management.Nmo Namespace
EventChronicleCollection.Add Method
EventChronicleCollection.Remove Method

Altre risorse

Chronicles Element for EventClass (ADF)
Definizione delle cronologie per una classe di evento