This statement queries data that is external to an instance of Analysis Services, by using an existing data source.
While OPENQUERY is similar in function to OPENROWSET, OPENQUERY has the following benefits:
A DMX query is much easier to write with OPENQUERY. Instead of creating a new connection string every time that you write a query, you can take advantage of the existing connection string in the data source. The data source object can also control data access for individual users.
The administrator has more control over how the data on the server is accessed. For example, the administrator can manage which providers are loaded into the server and which external data can be accessed.
This statement queries multiple data sources to create a nested table. By using SHAPE, you can combine data from multiple sources into a single hierarchical table. This lets you take advantage of the ability of Analysis Services to nest tables by imbedding a table within a table.
To specify the source data, you can also use the following options:
Any valid DMX statement
Any valid Multidimensional Expressions (MDX) statement