如何获取SSAS中的所有列名称

时间:2016-01-06 07:28:04

标签: sql sql-server ssas business-intelligence

在Sql Server中,我们将使用

获取所有列名
Select * from Informationschema.columns 

获取所有列名称

在SSAS中,我们如何获取任何多维数据集的所有列名 我们通过点击树格式的浏览来看,但我们如何在MDX查询中实现

请建议我SSAS是我的新领域

1 个答案:

答案 0 :(得分:1)

你可以试试这个:

SELECT [CATALOG_NAME] as [DATABASE],
      CUBE_NAME AS [CUBE],[DIMENSION_UNIQUE_NAME] AS [DIMENSION],
      LEVEL_CAPTION AS [ATTRIBUTE],
      [LEVEL_NAME_SQL_COLUMN_NAME] AS [ATTRIBUTE_NAME_SQL_COLUMN_NAME],
      [LEVEL_KEY_SQL_COLUMN_NAME] AS [ATTRIBUTE_KEY_SQL_COLUMN_NAME]
FROM $system.MDSchema_levels
WHERE CUBE_NAME  ='Adventure Works'
AND level_origin=2
AND LEVEL_NAME <> '(All)'
order by [DIMENSION_UNIQUE_NAME]

Source