共用方式為


ScheduledRule Element (ADF)

Contains elements that define a single subscription scheduled rule.

語法

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

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Required once or more per ScheduledRules element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

ScheduledRules Element (ADF)

Child elements

RuleName Element for ScheduledRule (ADF)

Action Element for ScheduledRule (ADF)

OR

ConditionAction Element (ADF)

ActionTimeout Element for ScheduledRule (ADF)

備註

Scheduled rules contain the notification generation rules for scheduled subscriptions. Microsoft SQL Server 2005 Notification Services runs the scheduled rule in each quantum that has scheduled subscriptions due to be processed.

The notification generation rule typically joins event data from an event chronicle table with the subscription information and generates a notifications based on matches.

A ScheduledRule element can contain either an Action element or a ConditionAction element, not both.

範例

The following example shows how to define a subscription schedule rule, named StockSubScheduledRule, that contains an Action. This rule creates notifications for scheduled subscriptions, and also loads notification data into a subscription chronicle for use in data mining on subscription trends. This ActionTimeout value of P0DT00H00M45S gives the rule 45 seconds to complete successfully.

<ScheduledRule>
    <RuleName>StockSubScheduledRule</RuleName>
    <Action>
    -- Generate notifications from the event chronicle
    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>

請參閱

參考

Application Definition File Reference

其他資源

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

說明及資訊

取得 SQL Server 2005 協助