다음을 통해 공유


ChronicleRule Element (ADF)

Provides a location for defining one or more Transact-SQL statements that maintain data in event chronicle tables.

구문

<EventClasses>
    <EventClass>
        ...
        <ChronicleRule>

Element Characteristics

Characteristic Description

Data type and length

None.

Default value

None.

Occurrence

Optional once per EventClass element. (See Remarks.)

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

EventClass Element (ADF)

Child elements

RuleName Element for ChronicleRule (ADF)

Action Element for ChronicleRule (ADF)

ActionTimeout Element for ChronicleRule (ADF)

주의

If you are using event chronicle tables, you must define a chronicle rule. The chronicle rule contains the Transact-SQL queries that manipulate the data in the event chronicle tables.

The following example shows a ChronicleRule element for creating an event chronicle rule named StockEventChronRule. This rule first inserts new stock data into the chronicle table, and then updates existing stock records in the chronicle table. The ActionTimeout value of P0DT00H05M00S gives the rule five minutes to complete successfully.

<ChronicleRule>
    <RuleName>StockEventChronRule</RuleName>
        <Action>
        -- Insert New Stock Symbols with Prices
        INSERT dbo.StockEventsChron (StockSymbol, StockPrice)
        SELECT e.StockSymbol, e.StockPrice
            FROM dbo.StockEvents AS e
            WHERE e.StockSymbol NOT IN 
                (SELECT StockSymbol FROM dbo.StockEventsChron);
        -- Update Existing Stock Symbols with New Prices
        UPDATE dbo.StockEventsChron
            SET StockPrice = e.StockPrice
            FROM dbo.StockEvents AS e 
            JOIN dbo.StockEventsChron AS c
                ON e.StockSymbol = c.StockSymbol
                WHERE e.StockPrice &gt; c.StockPrice;
        </Action>
    <ActionTimeout>P0DT00H05M00S</ActionTimeout>
</ChronicleRule>

참고 항목

참조

Application Definition File Reference

관련 자료

이벤트 클래스에 대한 기록 정의
이벤트 기록 규칙 정의
인스턴스 및 응용 프로그램 업데이트

도움말 및 정보

SQL Server 2005 지원 받기