I try this query
Insert into mining structure [Bike Buyer]
(
[Customer Key],
[Age],
[Bike Buyer] ,
[Commute Distance],
[Education],
[Gender],
[House Owner Flag],
[Marital Status],
[Number Cars Owned],
[Number Children At Home],
[Occupation],
[Region],
[Total Children],
[Yearly Income]
)
OPENQUERY ([AdventureWorks2008R2],
'SELECT [CustomerKey],[Age],[BikeBuyer],
[CommuteDistance],[EnglishEducation],
[Gender],[HouseOwnerFlag],
[MaritalStatus],[NumberCarsOwned],
[NumberChildrenAtHome],[EnglishOccupation],
[Region],[TotalChildren],[YearlyIncome]
FROM [dbo].[vTargetMail]'
)
但我有这个Erorr
“mta-PC \ mta”用户无权访问“AdventureWorks2008R2”对象,或者该对象不存在。
答案 0 :(得分:0)
每当我遇到此错误时,都是因为我将OpenQuery中引用的对象的名称设置为关系数据库或链接服务器的名称。必须将其设置为SSAS服务器上的数据源对象的名称。例如,如果您有一个名为AdventureWorks2008R2的数据库驻留在名为MyLinkedServer的链接服务器上,但您的Analysis Server通过名为MyADWorksDataSource的数据源访问数据,那么您将使用类似OPENQUERY的语句([MyADWorksDataSource]等这是违反直觉但有效的。请参阅Raymond Li对this thread on MSDN的回复。另请参阅this StackOverflow thread,其中同样的问题是罪魁祸首。