SubscriptionConditionScheduledRule.ActionTimeout Property

Gets or sets the interval during which the Transact-SQL statements specified in the SqlExpression property must complete successfully.

Spazio dei nomi: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintassi

'Dichiarazione
Public Property ActionTimeout As TimeSpan
public TimeSpan ActionTimeout { get; set; }
public:
property TimeSpan ActionTimeout {
    TimeSpan get ();
    void set (TimeSpan value);
}
/** @property */
public TimeSpan get_ActionTimeout ()

/** @property */
public void set_ActionTimeout (TimeSpan value)
public function get ActionTimeout () : TimeSpan

public function set ActionTimeout (value : TimeSpan)

Valore proprietà

A TimeSpan object that specifies the timeout interval.

Osservazioni

When using the default constructor, you must set this property. When using the other SubscriptionConditionScheduledRule(SubscriptionClass,String) constructor, the default time-out is 30 minutes.

You can alter this value when updating the application.

If the Transact-SQL statements do not complete in the specified interval, Notification Services cancels the rule firing and records an error in the application log.

Esempio

The following examples show how to define a condition-based, scheduled subscription rule and add it to a subscription class:

// Add a rule to generate condition-based, scheduled notifications
SubscriptionConditionScheduledRule flightConditionScheduledRule = 
    new SubscriptionConditionScheduledRule(
    flightSubscriptions, "FlightConditionScheduledRule");
flightConditionScheduledRule.ActionTimeout = 
    new TimeSpan(0, 2, 0);
flightConditionScheduledRule.SqlLoginName = "MyLowPrivLogin";
flightConditionScheduledRule.SqlUserName = "MyLowPrivUser";
flightConditionScheduledRule.InputTypeName = "FlightEventChronicle";
flightConditionScheduledRule.InputTypeSchema = "MyAppSchema";
flightConditionScheduledRule.SqlExpression =
    "INSERT INTO MyAppSchema.FlightNotifications (SubscriberId, " +
    "DeviceName, SubscriberLocale, LeavingFrom, GoingTo, Price) " +
    "SELECT [Subscription.SubscriberId], " +
    "[Subscription.DeviceName], [Subscription.SubscriberLocale], " +
    "[Input.LeavingFrom], [Input.GoingTo], [Input.Price] " +
    "FROM MyAppSchema.FlightConditionScheduledRule;";
flightSubscriptions.SubscriptionConditionScheduledRules.Add(
    flightConditionScheduledRule);
' Add a rule to generate condition-based, scheduled notifications
Dim flightConditionScheduledRule As _
    SubscriptionConditionScheduledRule = _
    New SubscriptionConditionScheduledRule( _
    flightSubscriptions, "FlightConditionScheduledRule")
flightConditionScheduledRule.ActionTimeout = _
    New TimeSpan(0, 2, 0)
flightConditionScheduledRule.SqlLoginName = "MyLowPrivLogin"
flightConditionScheduledRule.SqlUserName = "MyLowPrivUser"
flightConditionScheduledRule.InputTypeName = _
    "FlightEventChronicle"
flightConditionScheduledRule.InputTypeSchema = "MyAppSchema"
flightConditionScheduledRule.SqlExpression = _
    "INSERT INTO MyAppSchema.FlightNotifications " + _
 "(SubscriberId, DeviceName, SubscriberLocale, LeavingFrom, " + _
 "GoingTo, Price) SELECT [Subscription.SubscriberId], " + _
 "[Subscription.DeviceName], [Subscription.SubscriberLocale], " + _
 "[Input.LeavingFrom], [Input.GoingTo], [Input.Price] " + _
 "FROM MyAppSchema.FlightConditionScheduledRule;"
flightSubscriptions.SubscriptionConditionScheduledRules.Add( _
    flightConditionScheduledRule)

Thread Safety

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

SubscriptionConditionScheduledRule Class
SubscriptionConditionScheduledRule Members
Microsoft.SqlServer.Management.Nmo Namespace

Altre risorse

Definizione delle regole pianificate
Definizione di azioni condizionali
ScheduledRule Element (ADF)
ConditionAction Element (ADF)