Condividi tramite


ConditionAction Element (ADF)

Contains elements that describe a condition action for a subscription class event rule or scheduled rule.

Sintassi

<EventRule>
    ...
    <ConditionAction>
OR
<ScheduledRule>
    ...
    <ConditionAction>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Occurs at most once per EventRule or ScheduledRule, which can contain either an ConditionAction or Action.

Updates

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

Element Relationships

Relationship Elements

Parent element

EventRule Element (ADF) or ScheduledRule Element (ADF)

Child elements

SqlLogin Element (ADF)

SqlUser Element (ADF)

InputName Element (ADF)

InputSchema Element (ADF)

SqlExpression Element for ConditionAction (ADF)

Osservazioni

A condition action allows for flexible rules created by subscribers. ConditionAction elements contain elements that describe the input source and the query used to generate notifications from input and subscription data.

For more information about condition actions, see Definizione di azioni condizionali.

Esempio

The following example shows how to define a condition action. The query in the Transact-SQL expression selects data from the MyAppSchema.FlightEventRule view, which contains data from the subscription class and from the MyAppSchema.WeatherEvents event view.

<ConditionAction>
    <SqlLogin>[MyLowPrivLogin]</SqlLogin>
    <SqlUser>[MyLowPrivUser]</SqlUser>
    <InputName>WeatherEvents</InputName>
    <InputSchema>MyAppSchema</InputSchema>
    <SqlExpression>
        INSERT INTO MyAppSchema.WeatherNotifications(SubscriberId, 
        DeviceName, SubscriberLocale, City, Forecast) 
        SELECT [Subscription.SubscriberId], [Subscription.DeviceName],
               [Subscription.SubscriberLocale], [Input.City], 
               [Input.Forecast])
        FROM MyAppSchema.FlightEventRule;
    </SqlExpression>
</ConditionAction>

Vedere anche

Riferimento

Application Definition File Reference

Concetti

Instance Configuration File Reference

Altre risorse

Definizione di azioni condizionali
Definizione delle regole di sottoscrizione

Guida in linea e informazioni

Assistenza su SQL Server 2005