다음을 통해 공유


Action Element for ChronicleRule (ADF)

Provides a Transact-SQL statement that specifies the action to be taken in an event chronicle rule.

구문

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

Element Characteristics

Characteristic Description

Data type

string, between 1 and 100,000 characters in length.

Default value

None.

Occurrence

Required once per ChronicleRule element.

Updates

Can be modified, but not added or deleted, when updating the application.

Element Relationships

Relationship Elements

Parent element

ChronicleRule Element (ADF)

Child elements

None.

주의

The Action element can contain Transact-SQL statements that maintain the event chronicle, or can contain calls to stored procedures that maintain the event chronicle.

This example shows a populated Action element. The Transact-SQL statements insert a row into the chronicle table if the stock information doesn't exist, and update the stock information if a row already exists.

<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>

This example shows how to call a stored procedure that maintains the event chronicle.

<Action>
EXEC MyStoredProcdure;
</Action>

참고 항목

참조

Application Definition File Reference

관련 자료

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

도움말 및 정보

SQL Server 2005 지원 받기