MDX permission error when I call a table in SQL Server instance

早过忘川 提交于 2019-12-12 23:25:39

问题


I am trying to execute this query in MDX

INSERT INTO MINING STRUCTURE [People1]
([CustID], [Name], [Gender], [Age], [CarMake],[CarModel])
OPENQUERY(Chapter3Data,
'SELECT [Key], Name, Gender, Age, CarMake, CarModel
FROM People')

I have a database Chapter3Data with people table in my SQL Server instance, but I get this error :

Executing the query ...
Either the 'Ehsan\ehsan akbar' user does not have permission to access the 'Chapter3Data' object, or the object does not exist.
Execution complete


回答1:


This is not valid mdx:

SELECT [Key], Name, Gender, Age, CarMake, CarModel
FROM People

You need to specify which axis you would like the hierarchies ON - so generally ROWS or COLUMNS - an example might be:

SELECT 
   [Key].[Key].MEMBERS ON ROWS, 
   [Gender].[Gender].MEMBERS ON COLUMS
FROM People;

In SSMS you should be able to open with a connection to the cube server - then you can open an mdx query and test your mdx to ensure it is valid - a good idea before attempting the linked server OPENQUERY function.




回答2:


The problem is that you should be linking to the name of a Data Source defined on that instance of Analysis Services, not a relational database, or the name of a linked server, or a data source view (DSV). I made all three of those mistakes before finally getting it right, after stumbling on to Raymond Li's answer to the post titled DMX INSERT Openquery Permission Problem at MSDN. It's definitely counterintuitive of Microsoft to implement it this way, since you'd plug in a database or linked server any other time you use OPENQUERY, but that's what works.



来源:https://stackoverflow.com/questions/40095246/mdx-permission-error-when-i-call-a-table-in-sql-server-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!