共用方式為


EventClass.EventChronicles Property

Gets the EventChronicleCollection for the EventClass.

命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
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

屬性值

The EventChronicleCollection for the event class.

備註

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.

範例

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)

執行緒安全性

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.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

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

其他資源

Chronicles Element for EventClass (ADF)
定義事件類別的紀事輯