SubscriptionClass.SubscriptionScheduledRules Property

Gets the collection of parameter-based event rules for the subscription class.

Espace de noms: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntaxe

'Déclaration
Public ReadOnly Property SubscriptionScheduledRules As SubscriptionScheduledRuleCollection
public SubscriptionScheduledRuleCollection SubscriptionScheduledRules { get; }
public:
property SubscriptionScheduledRuleCollection^ SubscriptionScheduledRules {
    SubscriptionScheduledRuleCollection^ get ();
}
/** @property */
public SubscriptionScheduledRuleCollection get_SubscriptionScheduledRules ()
public function get SubscriptionScheduledRules () : SubscriptionScheduledRuleCollection

Valeur de propriété

The SubscriptionScheduledRuleCollection for the subscription class.

Notes

The SubscriptionScheduledRuleCollection represents the set of parameter-based SubscriptionScheduledRule objects for the subscription class. Use this collection to get, add, and remove SubscriptionScheduledRule objects for the subscription class.

Exemple

The following examples show how to define and add a scheduled subscription rule to a subscription class:

// Add a rule to generate basic scheduled notifications
SubscriptionScheduledRule flightScheduledRule = 
    new SubscriptionScheduledRule(
    flightSubscriptions, "FlightScheduledRule");
flightScheduledRule.Action = "INSERT INTO FlightNotifications " + 
    "(SubscriberId, DeviceName, SubscriberLocale, " +
    " LeavingFrom, GoingTo, Price) " + 
    " SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale, " +
    " EC.LeavingFrom, EC.GoingTo, EC.Price " + 
    " FROM FlightEventChronicle EC, FlightSubscriptions S " +
    " WHERE EC.LeavingFrom = S.LeavingFrom " + 
    " AND EC.GoingTo = S.GoingTo " +
    " AND EC.Price < S.Price";
flightScheduledRule.ActionTimeout = new TimeSpan(0, 0, 30);
flightSubscriptions.SubscriptionScheduledRules.Add(
    flightScheduledRule);
' Add a rule to generate basic scheduled notifications
Dim flightScheduledRule As SubscriptionScheduledRule = _
    New SubscriptionScheduledRule(flightSubscriptions, _
        "FlightScheduledRule")
flightScheduledRule.Action = _
    "INSERT INTO FlightNotifications " + _
    "(SubscriberId, DeviceName, SubscriberLocale, " + _
    "LeavingFrom, GoingTo, Price) " + _
    "SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale,  " + _
    "EC.LeavingFrom, EC.GoingTo, EC.Price " + _
    "FROM FlightEventChronicle EC, FlightSubscriptions S " + _
    "WHERE EC.LeavingFrom = S.LeavingFrom " + _
    "AND EC.GoingTo = S.GoingTo " + _
    "AND EC.Price < S.Price"
flightScheduledRule.ActionTimeout = New TimeSpan(0, 0, 30)
flightSubscriptions.SubscriptionScheduledRules.Add( _
    flightScheduledRule)

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

SubscriptionClass Class
SubscriptionClass Members
Microsoft.SqlServer.Management.Nmo Namespace
SubscriptionClass.SubscriptionConditionScheduledRules Property

Autres ressources

ScheduledRules Element (ADF)
Définition de règles planifiées