Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX Query


MDX Query

Author
Message
antonela
antonela
Valued Member
Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)

Group: General Forum Members
Points: 63 Visits: 176
Anybody knows how to put in a table of sql server the result of a MDX Query?

So, I write a MDX Query and I want to save the result in a sql server table.
davoscollective
davoscollective
Mr or Mrs. 500
Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)Mr or Mrs. 500 (599 reputation)

Group: General Forum Members
Points: 599 Visits: 1000
I've done this many times by creating a linked server in SQL server that connects to the SSAS instance.

Stacia has a good brief article about this

There are, however, some caveats and it tends to get very complicated very quickly.

If the SSAS instance and the SQL Server instance are on the same server then that makes things easier, but if they aren't you might come up against the double hop issue which requires you to get your hands dirty with kerberos.


You can't use dynamic SQL within an OPENQUERY call, but a workaround is that you can set the entire query as a variable which can then be dynamic, with the varchar limit of 8000. This is useful if you intend to make this a stored procedure.

The datatype difference between SSAS and SQL server can also trip you up. All the fields seem to be returned as ntext which can't be converted to many other types, so you might need to cast as varchar before casting as any other data type before inserting to your table.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search