Share via


EventClass.EventChronicles Property

Gets the EventChronicleCollection for the EventClass.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
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

Property Value

The EventChronicleCollection for the event class.

Remarks

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.

Example

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.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

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

Other Resources

Chronicles Element for EventClass (ADF)
Defining Chronicles for an Event Class