Поделиться через


EventClass Element (ADF)

Изменения: 5 декабря 2005 г.

Contains elements that define a single event class.

Синтаксис

<EventClasses>
    <EventClass>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

1 to 64 occurrences per EventClasses element.

Updates

Can be added, deleted, and modified when updating the application.

Element Relationships

Relationship Elements

Parent element

EventClasses Element (ADF)

Child elements

EventClassName Element for EventClass (ADF)

Schema Element for EventClass (ADF)

FileGroup Element for EventClass (ADF)

IndexSqlSchema Element for EventClass (ADF)

ChronicleRule Element (ADF)

Chronicles Element for EventClass (ADF)

Замечания

ms145858.note(ru-ru,SQL.90).gifВажно!
If you delete an EventClass, updating the application deletes the event class to which it corresponds, including all related SQL Server tables and indexes. Any data existing in the original event class tables is permanently deleted.

Пример

The following example shows an EventClass element and its child elements. It defines an event class that provides stock information to a notification application.

<EventClass>
    <EventClassName>StockEvents</EventClassName>
    <Schema>
        <Field>
            <FieldName>StockSymbol</FieldName>
            <FieldType>char(10)</FieldType>
            <FieldTypeMods>not null</FieldTypeMods>
        </Field>
        <Field>
            <FieldName>StockPrice</FieldName>
            <FieldType>money</FieldType>
            <FieldTypeMods>not null</FieldTypeMods>
        </Field>
    </Schema>
    <FileGroup>Primary</FileGroup>
    <IndexSqlSchema>
        <SqlStatement>
        CREATE CLUSTERED INDEX StockIndex
        ON StockEvents (StockSymbol)
        </SqlStatement>
    </IndexSqlSchema>
    <ChronicleRule>
        <RuleName>StockEventChronRule</RuleName>
        <Action>
        INSERT StockEventChron
        (StockSymbol, StockHighPrice)
        SELECT StockEvents.StockSymbol, StockEvents.StockPrice
        FROM StockEvents
        WHERE StockEvents.StockSymbol
        NOT IN (SELECT StockSymbol FROM StockEventChron)
        UPDATE StockEventChron
        SET StockEventChron.StockHighPrice = StockEvents.StockPrice
        FROM StockEvents JOIN StockEventChron
        ON StockEvents.StockSymbol = StockEventChron.StockSymbol 
        WHERE StockEvents.StockPrice &gt; 
            StockEventChron.StockHighPrice
        </Action>
        <ActionTimeout>P0DT00H05M00S</ActionTimeout>
    </ChronicleRule>
    <Chronicles>
        <Chronicle>
            <ChronicleName>StockEventChron</ChronicleName>
            <SqlSchema>
                <SqlStatement>
                IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
                WHERE TABLE_NAME = &apos;StockEventChron&apos;)
                DROP TABLE StockEventChron
                </SqlStatement>
                <SqlStatement>
                CREATE TABLE StockEventChron
                (
                StockSymbol char(10),
                StockHighPrice money
                PRIMARY KEY (StockSymbol)
                )
                </SqlStatement>
            </SqlSchema>
        </Chronicle>
    </Chronicles>
</EventClass>

Change History

Release History

5 декабря 2005 г.

Changed content:
  • Updated Occurrence description with limit of 1 to 64 event classes.

См. также

Справочник

Application Definition File Reference

Другие ресурсы

Определение свойств основного класса событий
Обновление экземпляров и приложений

Справка и поддержка

Получение помощи по SQL Server 2005