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.
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
EventClass Class
EventClass Members
Microsoft.SqlServer.Management.Nmo Namespace
EventChronicleCollection.Add Method
EventChronicleCollection.Remove Method
Другие ресурсы
Chronicles Element for EventClass (ADF)
Определение хроники для класса событий