![]() |
---|
下一版本的 Microsoft SQL Server 将删除该功能。请不要在新的开发工作中使用该功能,并尽快修改当前还在使用该功能的应用程序。 |
The MemberKeyColumn property of the Level interface contains the name or expression of the column that contains member keys.
Applies To:clsAggregationLevel, clsCubeLevel, clsDatabaseLevel, clsPartitionLevel
Data Type
String
Access
Access depends on the value of the ClassType property of the object.
Class type | Access |
---|---|
clsDatabaseLevel |
R/W |
clsCubeLevel |
R/W* |
clsPartitionLevel |
R/W |
clsAggregationLevel |
R/W |
* Read-only for virtual cube levels.
备注
Some general considerations concerning the MemberKeyColumn property are as follows:
In relational terms, a key is a set of one or more columns that uniquely identify an entity. MemberKeyColumn is a key in this sense if the AreMemberKeysUnique property of a level is True. If AreMemberKeysUnique is False, MemberKeyColumn uniquely identifies a member within the context of a parent member only. For example, months are unique only within the context of a given year.
The MemberKeyColumn property controls the way the dimensions within a cube are processed. To improve cube-processing efficiency, when you create levels, make sure the lowest level has unique members.
Often, the fact table will contain member key values but not necessarily member names. The user, however, sees the member names rather than the keys.
MemberKeyColumn can contain any valid SQL expression that involves one or more columns from a single table. For example, either of the following is a valid expression that uses the Product.Prod_Year column:
"""Product"".""Prod_Year""" DatePart('q',"Product"."Prod_Year")
注意:
If this property contains an SQL expression, the expression must be compatible with the SQL dialect supported by the OLE DB provider. Using an incompatible expression will result in an error when the cube is processed.
示例
Use the following code to set a level object MemberKeyColumn to the Customer_Number column in table Customer:
LevelObject.MemberKeyColumn = """Customer"".""Customer_Number"""
请参阅
参考
AreMemberKeysUnique (Level Interface)
Level Interface
MemberNameColumn (Level Interface)