Describes each level within a particular hierarchy.
The MDSCHEMA_LEVELS rowset contains the following columns.
|Column name||Type indicator||Description|
|CATALOG_NAME||DBTYPE_WSTR||The name of the catalog to which this level belongs. NULL if the provider does not support catalogs.|
|SCHEMA_NAME||DBTYPE_WSTR||The name of the schema to which this level belongs. NULL if the provider does not support schemas.|
|CUBE_NAME||DBTYPE_WSTR||The name of the cube to which this level belongs.|
|DIMENSION_UNIQUE_NAME||DBTYPE_WSTR||The unique name of the dimension to which this level belongs. For providers that generate unique names by qualification, each component of this name is delimited.|
|HIERARCHY_UNIQUE_NAME||DBTYPE_WSTR||The unique name of the hierarchy. If the level belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For providers that generate unique names by qualification, each component of this name is delimited.|
|LEVEL_NAME||DBTYPE_WSTR||The name of the level.|
|LEVEL_UNIQUE_NAME||DBTYPE_WSTR||The properly escaped unique name of the level.|
|LEVEL_CAPTION||DBTYPE_WSTR||A label or caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, LEVEL_NAME is returned.|
|LEVEL_NUMBER||DBTYPE_UI4||The distance of the level from the root of the hierarchy. Root level is zero (0).|
|LEVEL_CARDINALITY||DBTYPE_UI4||The number of members in the level.|
|LEVEL_TYPE||DBTYPE_I4||Type of the level:
|DESCRIPTION||DBTYPE_WSTR||A human-readable description of the level. NULL if no description exists.|
|CUSTOM_ROLLUP_SETTINGS||DBTYPE_I4||A bitmap that specifies the custom rollup options:
MDLEVELS_CUSTOM_ROLLUP_EXPRESSION (0x01) indicates an expression exists for this level. (Deprecated)
MDLEVELS_CUSTOM_ROLLUP_COLUMN (0x02) indicates that there is a custom rollup column for this level.
MDLEVELS_SKIPPED_LEVELS (0x04) indicates that there is a skipped level associated with members of this level.
MDLEVELS_CUSTOM_MEMBER_PROPERTIES (0x08) indicates that members of the level have custom member properties.
MDLEVELS_UNARY_OPERATOR (0x10) indicates that members on the level have unary operators.
|LEVEL_UNIQUE_SETTINGS||DBTYPE_I4||A bitmap that specifies which columns contain unique values, if the level only has members with unique names or keys. The Msmd.h file defines the following bit value constants for this bitmap:
Note that the key is always unique in Microsoft SQL Server Analysis Services. The name will be unique if the setting on the attribute is UniqueInDimension or UniqueInAttribute
|LEVEL_IS_VISIBLE||DBTYPE_BOOL||A Boolean that indicates whether the level is visible.
Always returns True. If the level is not visible, it will not be included in the schema rowset.
|LEVEL_ORDERING_PROPERTY||DBTYPE_WSTR||The ID of the attribute that the level is sorted on.|
|LEVEL_DBTYPE||DBTYPE_I4||The DBTYPE enumeration of the member key column that is used for the level attribute.
Null if concatenated keys are used as the member key column.
|LEVEL_MASTER_UNIQUE_NAME||DBTYPE_WSTR||Always returns NULL.|
|LEVEL_NAME_SQL_COLUMN_NAME||DBTYPE_WSTR||The SQL representation of the level member names.|
|LEVEL_KEY_SQL_COLUMN_NAME||DBTYPE_WSTR||The SQL representation of the level member key values.|
|LEVEL_UNIQUE_NAME_SQL_COLUMN_NAME||DBTYPE_WSTR||The SQL representation of the member unique names.|
|LEVEL_ATTRIBUTE_HIERARCHY_NAME||DBTYPE_WSTR||The name of the attribute hierarchy providing the source of the level.|
|LEVEL_KEY_CARDINALITY||DBTYPE_UI2||The number of columns in the level key.|
|LEVEL_ORIGIN||DBTYPE_UI2||A bit map that defines how the level was sourced:
MD_ORIGIN_USER_DEFINED identifies levels in a user defined hierarchy.
MD_ORIGIN_ATTRIBUTE identifies levels in an attribute hierarchy.
MD_ORIGIN_KEY_ATTRIBUTE identifies levels in a key attribute hierarchy.
MD_ORIGIN_INTERNAL identifies levels in attribute hierarchies that are not enabled.
The rowset is sorted on CATALOG_NAME, SCHEMA_NAME, CUBE_NAME, DIMENSION_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, LEVEL_NUMBER.
The MDSCHEMA_LEVELS rowset can be restricted on the columns listed in the following table.
|Column name||Type indicator||Restriction State|
|LEVEL_ORIGIN||DBTYPE_UI2||(Optional) A default restriction is in effect on MD_USER_DEFINED and MD_SYSTEM_ENABLED|
|CUBE_SOURCE||DBTYPE_UI2||(Optional) Default restriction is a value of 1. A bitmap with one of the following valid values:
|LEVEL_VISIBILITY||DBTYPE_UI2||(Optional) Default restriction is a value of 1. A bitmap with one of the following values:
2 Not visible