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