![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am new to MDX. I use the following query in SQL server to pull data from an Analysis Service DB using a linked server. The new table created has column names with square braces. I would like to rename the columns when data is fetched. select * into MyData from OPENQUERY(AS_LINK, ' SELECT { [Measures].[sales amount], [Measures].[tax amt] } ON 0, non empty nest([order date].[calendaryear].[2001],[order date].[englishmonthname].Members ) ON 1 FROM [astutorial] where ([product].[model name].members) ') |
#3
| |||
| |||
|
|
It is easiest to do this in the outer SQL query eg. select [[Measures].[sales amount]] as Sales [[Measures].[tax amt]] as Tax ... into MyData from OPENQUERY(AS_LINK, ' SELECT { [Measures].[sales amount], [Measures].[tax amt] } ON 0, non empty nest([order date].[calendaryear].[2001],[order date].[englishmonthname].Members ) ON 1 FROM [astutorial] where ([product].[model name].members) ') -- Regards Darren Gosbell - SQL Server MVP Blog: http://www.geekswithblogs.net/darrengosbell In article <E719D31D-5DFE-4DA0-BBF8-B17ACE6E8D93 (AT) microsoft (DOT) com>, DM (AT) discussions (DOT) microsoft.com says... I am new to MDX. I use the following query in SQL server to pull data from an Analysis Service DB using a linked server. The new table created has column names with square braces. I would like to rename the columns when data is fetched. select * into MyData from OPENQUERY(AS_LINK, ' SELECT { [Measures].[sales amount], [Measures].[tax amt] } ON 0, non empty nest([order date].[calendaryear].[2001],[order date].[englishmonthname].Members ) ON 1 FROM [astutorial] where ([product].[model name].members) ') |
![]() |
| Thread Tools | |
| Display Modes | |
| |