how to get all column names in SSAS

时间:2022-09-23 21:41:28

In Sql Server we will get all column names by using

在Sql Server中,我们将使用获取所有列名

Select * from Informationschema.columns 

to get all column names

获取所有列名称

In SSAS how can we get all column names for any cube we an see by clicking on browse in Tree Format but how can we achieve in MDX Query

在SSAS中,如何通过单击Tree Format中的browse来获取我们看到的任何多维数据集的所有列名,但是我们如何在MDX查询中实现

please suggest me SSAS is new area for me

请建议我SSAS是我的新领域

1 个解决方案

#1


1  

You can try this:

你可以试试这个:

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

#1


1  

You can try this:

你可以试试这个:

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