SubscriptionScheduledRule.ActionTimeout Property
Gets or sets the timeout interval for the schedule rule. The action must complete within the interval, or is cancelled.
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 action timeout for the rule.
Osservazioni
When using the default constructor, you must set this property. When using the SubscriptionScheduledRule(SubscriptionClass,String) constructor, the default time-out is 30 minutes.
If an action does not complete in the time specified, the action is canceled and an error is recorded in the Microsoft Windows Application log.
Esempio
The following examples show how to define a scheduled rule and add it 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)
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
SubscriptionScheduledRule Class
SubscriptionScheduledRule Members
Microsoft.SqlServer.Management.Nmo Namespace
Altre risorse
Definizione delle regole pianificate
ActionTimeout Element for ScheduledRule (ADF)
ScheduledRule Element (ADF)