1

Good day!

Can anybody tell me if there is an analog of "use" in mdx query? Or how can I change catalog context?

My task is to get data from olap using mdx query in OpenQuery. I can determine initial catalog on linked server, but there are several catalogs on OLAP server and I want to use one linked server to get access to all catalogs.

ventik
  • 877
  • 7
  • 18
  • Have a look at this one: http://stackoverflow.com/questions/25712189/linked-server-dynamic-catalog-for-executing-mdx-through-openquery Maybe it has the answer you're looking for. – Horia Jul 28 '15 at 09:54
  • Thanks. I should search more carefully in further. – ventik Jul 28 '15 at 10:21

1 Answers1

2

This is not possible with OpenQuery. You need to have separate linked servers for each catalog as OpenQuery executes the MDX only against the default catalog of the linked server.

If this is not feasible try using OpenRowset where you can specify string parameters to pass correct catalog information.

See information on OpenRowSet here https://support.microsoft.com/en-us/kb/218592

DhruvJoshi
  • 17,041
  • 6
  • 41
  • 60