Sdílet prostřednictvím


MemberKeyColumn (Level Interface)

Note

  This feature will be removed in the next version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.

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.

Remarks

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")
    

    Note

    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.

Example

Use the following code to set a level object MemberKeyColumn to the Customer_Number column in table Customer:

LevelObject.MemberKeyColumn = """Customer"".""Customer_Number"""