共用方式為


ScheduledRules Element (ADF)

Provides a location for all subscription scheduled rule definitions for one subscription class.

語法

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <ScheduledRules>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Optional once per SubscriptionClass element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

SubscriptionClass Element (ADF)

Child elements

ScheduledRule Element (ADF)

備註

The ScheduledRules element contains one or more scheduled rules for the subscription class. Scheduled rules contain the notification generation rules for scheduled subscriptions.

範例

The following example shows a ScheduledRules element with two scheduled rules. The first scheduled rule creates notifications and updates chronicle data. The second scheduled rule archives subscription information.

<ScheduledRules>
    <ScheduledRule>
        <RuleName>StockSubScheduledRule</RuleName>
        <Action>
        -- Generate Notifications
        INSERT INTO ScheduledNotifications
        ( SubscriberId, DeviceName, SubscriberLocale,
          StockSymbol, StockPrice )
        SELECT S.SubscriberId, S.DeviceName, 
            S.SubscriberLocale, C.StockSymbol, C.StockPrice
        FROM StockSubscriptions S JOIN StockEventChron C
        ON S.StockSymbol = C.StockSymbol 
        WHERE S.StockTriggerPrice &lt;= C.StockHighPrice 
        GROUP BY S.StockSymbol, C.StockHighPrice
        -- Maintain the subscription chronicle
        INSERT StockSubscriptionChron
        (SubscriberId, StockSymbol, StockPrice)
        SELECT S.SubscriberId, S.StockSymbol, C.StockHighPrice
        FROM StockSubscriptions S JOIN StockEventChron C
        ON S.StockSymbol = C.StockSymbol
        </Action>
        <ActionTimeout>P0DT00H00M45S</ActionTimeout>
    </ScheduledRule>
    <ScheduledRule>
        <RuleName>StockSubArchiveRule</RuleName>
        <Action>
        -- Maintain an archive table
        INSERT StockSubscriptionArchive
        (SubscriberId, StockSymbol, StockPrice, ArchiveDate)
        SELECT S.SubscriberId, S.StockSymbol, S.StockPrice, GETDATE()
        FROM StockSubscriptionsChron S
        </Action>
        <ActionTimeout>P0DT00H01M00S</ActionTimeout>
    </ScheduledRule>
</ScheduledRules> 

請參閱

參考

Application Definition File Reference

其他資源

定義排程規則
更新執行個體及應用程式

說明及資訊

取得 SQL Server 2005 協助