다음을 통해 공유


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)
이벤트 클래스에 대한 기록 정의