dbTalk Databases Forums  

Openquery on OLAP data source

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Openquery on OLAP data source in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James
 
Posts: n/a

Default Openquery on OLAP data source - 11-07-2003 , 07:27 AM






From Query Analyser, I can run an MDX query on my OLAP
cube, but I miss the syntax to specify the columns in the
resulting recordset. Could you guys help me?

I cannot figure out how to specify the column [Measures].
[Net Sales] in the SELECT statement. Instead of "SELECT
a.* ", I want some sort of "SELECT a.[Measures].[Net
Sales]"


The query returns:

[Time].[Marketing].[Year].[MEMBER_CAPTION] [Measures].[Net
Sales]
------------------------------------------ ----------------
------
Current 30954618.01

(1 row(s) affected)



SELECT a.*
FROM OPENROWSET('MSOLAP',
'Data Source=SERVER;Initial Catalog=AnDB;Integrated
Security=SSPI',
'
select
{([Measures].[Net Sales]) } on columns,
{([Time.Marketing].[Year].[Current] )} on rows
from [Item Sale]') AS a


Reply With Quote
  #2  
Old   
Michael Shao [MSFT]
 
Posts: n/a

Default RE: Openquery on OLAP data source - 11-09-2003 , 10:19 PM






Hi James,

Thanks for your post. As I understand, you want to specify the column
[Measures].[Net Sales] in the record set that resulted from implementing
OPENROWSEST. If I have misunderstood, please feel free to let me know.

In this case, you can try to type "[Measures].[Store Cost]" (include Quoted
identifiers) to specify the column [Measures].[Net Sales] from the record
set.

For more information regarding this issue, please refer to the following
article on SQL Server Books Online.
Topic: "Delimiting Result Set Column Names"

Please feel free to post in the group if this solves your problem or if you
would like further assistance.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.