JoinClause Class
Represents a join between columns of two tables or views.
命名空间: Microsoft.SqlServer.NotificationServices.Rules
程序集: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
语法
声明
Public Class JoinClause
Inherits RuleObject
public class JoinClause : RuleObject
public ref class JoinClause : public RuleObject
public class JoinClause extends RuleObject
public class JoinClause extends RuleObject
备注
This class cannot be inherited.
JoinClause objects are used to join two tables or views on source and target columns. For rules, JoinClause objects are used to join InputType objects and FilterRule objects.
You must set the SourceColumn and TargetColumn properties.
Inheritance Hierarchy
System.Object
Microsoft.SqlServer.NotificationServices.Rules.RuleObject
Microsoft.SqlServer.NotificationServices.Rules.JoinClause
示例
The following example shows how to use JoinClause objects to define a chain of joins between an event view and a 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.
平台
开发平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
目标平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
请参阅
参考
JoinClause Members
Microsoft.SqlServer.NotificationServices.Rules Namespace