DefaultMember (Dimension Interface)

ms135443.note(zh-tw,SQL.90).gif附註:
  下一版的 Microsoft SQL Server 將不再提供此功能。請勿在新的開發工作中使用此功能,並且儘速修改使用此功能的應用程式。

The DefaultMember property of the Dimension interface defines the default member of the dimension.

Applies To:clsAggregationDimension, clsCubeDimension, clsDatabaseDimension, clsPartitionDimension

Data Type

String

Access

Access depends on the value of the ClassType property of the object.

Class type Access

clsDatabaseDimension

R/W

clsCubeDimension

R

clsPartitionDimension

R

clsAggregationDimension

R

備註

DefaultMember is used to evaluate Multidimensional Expressions (MDX) expressions in which no context for the dimension is available. This property contains an MDX expression that evaluates to a single member of the dimension to which the property belongs. If blank, the Analysis server uses one of the members on the topmost level of the dimension as the default member. For example, if you define Redmond as the default member of the Geography dimension, tuples such as (Sales, 1997) can be evaluated as (Sales, 1997, Redmond).

範例

The following code example sets the default member to Food for the Product dimension in the FoodMart 2000 database:

' Assume the existence of a database dimension named dsoDim.
dsoDim.DefaultMember = "Food"

請參閱

參考

Dimension Interface

說明及資訊

取得 SQL Server 2005 協助