다음을 통해 공유


LinkLeafCondition Constructor (LinkLeafOperator, FilterRule, JoinClause[])

Initializes a new instance of the LinkLeafCondition class with a LinkLeafOperator object, a FilterRule object, and zero or more JoinClause objects.

네임스페이스: Microsoft.SqlServer.NotificationServices.Rules
어셈블리: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)

구문

‘선언
Public Sub New ( _
    op As LinkLeafOperator, _
    filter As FilterRule, _
    ParamArray linkChain As JoinClause() _
)
public LinkLeafCondition (
    LinkLeafOperator op,
    FilterRule filter,
    params JoinClause[] linkChain
)
public:
LinkLeafCondition (
    LinkLeafOperator op, 
    FilterRule^ filter, 
    ... array<JoinClause^>^ linkChain
)
public LinkLeafCondition (
    LinkLeafOperator op, 
    FilterRule filter, 
    JoinClause[] linkChain
)
public function LinkLeafCondition (
    op : LinkLeafOperator, 
    filter : FilterRule, 
    ... linkChain : JoinClause[]
)

매개 변수

  • op
    The operator applied to the filter results.
  • filter
    A FilterRule whose logic determines whether rows from the table or view related through the linkChain match the op criteria.
  • linkChain
    Zero or more JoinClause instances describing the link between the table or view this condition references and the InputType of the filter.

주의

If you do not define a filter, you must set the Filter property.

The following example shows how to define a filter and a subscription that uses that filter in a link leaf condition.

The filter determines which products are in the Subassembly production phase. Only events that match the filter will be used when evaluating the subscription.

The subscription itself uses the Any operator, the toolCrib function just defined, and specifies the link chain between the event view and the product location, in which the event view is linked 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();

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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