SubscriptionConditionEventRule クラスの新しいインスタンスを初期化します。
名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)
構文
'宣言
Public Sub New
public SubscriptionConditionEventRule ()
public:
SubscriptionConditionEventRule ()
public SubscriptionConditionEventRule ()
public function SubscriptionConditionEventRule ()
解説
更新されたテキスト :2005 年 12 月 5 日
更新されたサンプル コード :2005 年 12 月 5 日
既定のコンストラクタを使用する場合は、最初に Name を設定してから Parent を設定し、その後でその他のプロパティを設定します。このコンストラクタでは、いずれのプロパティ値も設定されません。
使用例
次の例は、この既定のコンストラクタを使用して条件ベースのイベント ドリブン サブスクリプション ルールを作成し、ルールをサブスクリプション クラスに追加する方法を示しています。
' Create a condition-based event rule and set properties.
Dim flightConditionEventRule As SubscriptionConditionEventRule = _
New SubscriptionConditionEventRule()
flightConditionEventRule.Name = "FlightConditionEventRule"
flightConditionEventRule.Parent = flightSubscriptions
flightConditionEventRule.EventClassName = "FlightEvents"
flightConditionEventRule.ActionTimeout = New TimeSpan(0, 30, 0)
flightConditionEventRule.SqlLoginName = "MyLowPrivLogin"
flightConditionEventRule.SqlUserName = "MyLowPrivUser"
flightConditionEventRule.InputTypeName = "FlightEvents"
flightConditionEventRule.InputTypeSchema = "dbo"
flightConditionEventRule.SqlExpression = _
"INSERT INTO dbo.FlightNotifications (SubscriberId, " + _
"DeviceName, SubscriberLocale, LeavingFrom, GoingTo, Price) " + _
"SELECT [Subscription.SubscriberId], [Subscription.DeviceName], " + _
"[Subscription.SubscriberLocale], " + _
"[Input.LeavingFrom], [Input.GoingTo], [Input.Price] " + _
"FROM dbo.FlightConditionEventRule;"
flightSubscriptions.SubscriptionConditionEventRules.Add(flightConditionEventRule)
// Create a condition-based event rule and set properties.
SubscriptionConditionEventRule flightConditionEventRule =
new SubscriptionConditionEventRule();
flightConditionEventRule.Name = "FlightConditionEventRule";
flightConditionEventRule.Parent = flightSubscriptions;
flightConditionEventRule.EventClassName = "FlightEvents";
flightConditionEventRule.ActionTimeout = new TimeSpan(0, 30, 0);
flightConditionEventRule.SqlLoginName = "MyLowPrivLogin";
flightConditionEventRule.SqlUserName = "MyLowPrivUser";
flightConditionEventRule.InputTypeName = "FlightEvents";
flightConditionEventRule.InputTypeSchema = "dbo";
flightConditionEventRule.SqlExpression =
"INSERT INTO dbo.FlightNotifications (SubscriberId, " +
"DeviceName, SubscriberLocale, LeavingFrom, GoingTo, Price) " +
"SELECT [Subscription.SubscriberId], [Subscription.DeviceName], " +
"[Subscription.SubscriberLocale], " +
"[Input.LeavingFrom], [Input.GoingTo], [Input.Price] " +
"FROM dbo.FlightConditionEventRule;";
flightSubscriptions.SubscriptionConditionEventRules.Add(
flightConditionEventRule);
プラットフォーム
開発プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
対象プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
参照
関連項目
SubscriptionConditionEventRule Class
SubscriptionConditionEventRule Members
Microsoft.SqlServer.Management.Nmo Namespace