Поделиться через


LinkLeafCondition.LinkChain Property

Gets an ordered collection of JoinClause instances describing the link between the table or view this condition references and the InputType of the Filter element.

Пространство имен: Microsoft.SqlServer.NotificationServices.Rules
Сборка: Microsoft.SqlServer.NotificationServices.Rules (in 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>

Значение свойства

A Collection of JoinClause objects.

Замечания

If this chain is empty, the Filter must have the same InputType table or view as this condition.

Links in the chain must follow these rules:

  • The first JoinClause in the chain must have a SourceColumn value that belongs to the InputType table or view of this condition.

  • Subsequent JoinClause objects must have SourceColumn columns in the same table or view as the TargetColumn of the previous element.

  • The final link in the chain must have a TargetColumn in the same table or view as the InputType of the Filter.

Пример

The following example shows the link chain defined for a subscription. The link chain links the event view to the inventory table, which is linked to the location table:

// 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();

Синхронизация потоков

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.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

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