MemberNameColumn (Level Interface)

注意

  この機能は、Microsoft SQL Server の次のバージョンで削除されます。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションはできるだけ早く修正してください。

The MemberNameColumn property of the Level interface contains the name of the column that contains member names.

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

clsPartitionLevel

R

clsAggregationLevel

R

* Read-only for virtual cube levels, levels with a LevelType property of levAll, and levels with a Grouping of groupingAutomatic.

説明

This property is useful when the member key column may not contain information recognizable to the user.

For example, a table may contain the columns SKU and Product_Name. When you generate queries by SKU number, you may want to display the corresponding product name for the sake of clarity. In this case, the member key column is SKU, but the member name column is Product_Name.

If you do not assign a value to MemberNameColumn, the Analysis server uses the MemberKeyColumn values for the member names.

Be careful when using expressions in MemberNameColumn that are based on columns other than those specified by MemberKeyColumn. Ensure that there is always a one-to-one correspondence in the values produced by the expressions in MemberNameColumn and MemberKeyColumn.

The MemberNameColumn property can contain any valid SQL expression involving one or more columns from the table that contains the member key column. Such an expression can be used to produce a calculated or concatenated string expression. For example, the following is a valid expression for a Product.Prod_Year member key column:

'Quarter ' & Format(DatePart('q',"Product"."Prod_Year"))

The following is another example from an Employees table:

"Employees"."LastName" + ', ' + "Employees"."Firstname"
注意

  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 the MemberNameColumn property of a level object to the Product_Name column in table Sales:

' Assume an object (dsoLev) of ClassType clsLevel exists
dsoLev.MemberNameColumn = """Sales"".""Product_Name"""