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"""
请参阅
参考
Level Interface
MemberKeyColumn (Level Interface)