次の方法で共有


LinkLeafCondition.LinkChain Property

この条件が参照するテーブルまたはビューと、Filter 要素の InputType との間のリンクを説明する、JoinClause インスタンスの順序付きコレクションを取得します。

名前空間: Microsoft.SqlServer.NotificationServices.Rules
アセンブリ: Microsoft.SqlServer.NotificationServices.Rules (microsoft.sqlserver.notificationservices.rules.dll 内)

構文

'宣言
Public ReadOnly Property LinkChain As Collection(Of JoinClause)
public Collection<JoinClause> LinkChain { get; }
public:
property Collection<JoinClause^>^ LinkChain {
    Collection<JoinClause^>^ get ();
}
/** @property */
public Collection<JoinClause> get_LinkChain ()
public function get LinkChain () : Collection<JoinClause>

プロパティ値

JoinClause オブジェクトの Collection です。

解説

このチェーンが空である場合、Filter にはこの条件と同じ InputType テーブルまたはビューが必要です。

チェーン内のリンクは、次のルールに従う必要があります。

  • チェーン内の最初の JoinClause には、この条件の InputType テーブルまたはビューに属する SourceColumn 値が必要です。

  • 後続の JoinClause オブジェクトでは、前の要素の TargetColumn と同じテーブルまたはビュー内に SourceColumn 列が存在している必要があります。

  • チェーン内の最後のリンクでは、FilterInputType と同じテーブルまたはビューに TargetColumn が存在している必要があります。

使用例

次の例では、サブスクリプションに使用するリンク チェーンを定義します。リンク チェーンによりイベント ビューが inventory テーブルにリンクされ、その inventory テーブルが location テーブルにリンクされます。

// Subscribe to products in Subassembly location. This
// requires select permissions on all tables in the sample.

//Specify server and database.
Server server = new Server("MyServer");
Database db = server.Databases[nsApplication.DatabaseName];

// Specify tables and views used by the condition.
Table locationTable = db.Tables["Location", "Production"];
Table inventoryTable = db.Tables["ProductInventory", "Production"];
View eventView = db.Views["InventoryTrackerEvents",
    "NS_InventoryTrackerApplication"];

// Filter defining "Subassembly" locations.
FilterRule toolCrib = new FilterRule(
    new TableInputType(db.Tables["Location", "Production"]),
    new SimpleLeafCondition(new FieldValue("Name"),
        SimpleOperator.Equals, "Subassembly"));

// Create subscription and define basic properties.
s = new Subscription(nsApplication, subscriptionClassName);
s.SubscriberId = "Stephanie";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s.SetFieldValue("DeviceName", "myDevice");
s.SetFieldValue("SubscriberLocale", "en-us");

// Define a condition using the filter.
s.Condition = new LinkLeafCondition(
    LinkLeafOperator.Any,
    toolCrib,
    new JoinClause(eventView.Columns["ProductId"],
        inventoryTable.Columns["ProductId"]),
    new JoinClause(inventoryTable.Columns["LocationId"],
        locationTable.Columns["LocationId"]));

// Add subscription.
s.Add();

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

LinkLeafCondition Class
LinkLeafCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace