Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MDX Query Expand / Collapse
Author
Message
Posted Tuesday, January 1, 2013 1:08 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 20, 2014 4:00 AM
Points: 49, Visits: 84
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.
Post #1401621
Posted Tuesday, January 1, 2013 10:55 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 3:03 AM
Points: 450, Visits: 842
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.
Post #1401656
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse