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
Posted Tuesday, January 1, 2013 1:08 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, October 23, 2014 4:44 AM
Points: 52, Visits: 91
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



Group: General Forum Members
Last Login: Thursday, December 18, 2014 4:24 AM
Points: 495, Visits: 895
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