SubscriptionScheduledRule Constructor ()
Initializes a new instance of the SubscriptionScheduledRule class.
命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
語法
'宣告
Public Sub New
public SubscriptionScheduledRule ()
public:
SubscriptionScheduledRule ()
public SubscriptionScheduledRule ()
public function SubscriptionScheduledRule ()
備註
更新的文字:2005 年 12 月 5 日
更新的範例程式碼:2005 年 12 月 5 日
When using the default constructor, first set the Name, then the Parent and then other properties to avoid runtime exceptions. This constructor does not set any property values.
範例
The following examples show how to use this default constructor to create a scheduled rule and then add the rule to a subscription class:
// Create a scheduled rule and set properties.
SubscriptionScheduledRule flightScheduledRule =
new SubscriptionScheduledRule();
flightScheduledRule.Name = "FlightScheduledRule";
flightScheduledRule.Parent = flightSubscriptions;
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, 30, 0);
flightSubscriptions.SubscriptionScheduledRules.Add(
flightScheduledRule);
' Create a scheduled rule and set properties.
Dim flightScheduledRule As SubscriptionScheduledRule = _
New SubscriptionScheduledRule()
flightScheduledRule.Name = "FlightScheduledRule"
flightScheduledRule.Parent = flightSubscriptions
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, 30, 0)
flightSubscriptions.SubscriptionScheduledRules.Add(flightScheduledRule)
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
SubscriptionScheduledRule Class
SubscriptionScheduledRule Members
Microsoft.SqlServer.Management.Nmo Namespace