sqlserver-OPENQUERY
我正在使用一个Openquey,它在SQLServer2005上运行良好,我有一个服务器是SQLServer2008,但它不工作 如果我运行以下命令:sqlserver-OPENQUERY,sql,sql-server-2005,sql-server-2008,Sql,Sql Server 2005,Sql Server 2008,我正在使用一个Openquey,它在SQLServer2005上运行良好,我有一个服务器是SQLServer2008,但它不工作 如果我运行以下命令: SELECT * FROM OPENQUERY([Manchester], '[Manchester].[PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'', ''10/10/2009''') 我得到这个错误: Cannot process the o
SELECT *
FROM OPENQUERY([Manchester],
'[Manchester].[PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'',
''10/10/2009''')
我得到这个错误:
Cannot process the object "[Manchester].[PilotWebApp].[DBO].rsp_HandheldPerformance '10/01/2009', '10/10/2009'".
The OLE DB provider "SQLNCLI" for linked server "Manchester" indicates that either the object has no columns or the current user does not have permissions on that object.
如果我只是跑:
[Manchester].[PilotWebApp].[DBO].rsp_HandheldPerformance '10/01/2009', '10/10/2009'
它很好用。2008年有什么变化吗
它所做的是从openquery中获取数据并插入到我的临时表中:
INSERT #TempHandheldPerformance SELECT * FROM OPENQUERY([Manchester], '[Manchester].PilotWebApp.DBO.rsp_HandheldPerformance ''10/01/2009'', ''10/10/2009''')
验证链接服务器是否使用与您相同的凭据。您可以在链接服务器属性中找到它们,然后在安全选项中找到它们。检查并确保远程框中没有名为[Manchester]的链接服务器;您的语法可以解释为: 从本地服务器连接到名为Manchester的链接服务器,然后在另一个名为Manchester的链接服务器上执行存储过程
斯图即使是2009年的问题,我在2012年也遇到了同样的问题!!而且要找到答案有点困难……无论如何,在执行SP之前只使用了SETNOCOUNT ON 如果Manchester是LinkedServer,则设置为NOCOUNT的示例代码应为
SELECT *
FROM OPENQUERY([Manchester],
'SET NOCOUNT ON; EXEC [PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'',
''10/10/2009''')
为了填补临时表格,我做了
SELECT *
INTO #temptable
FROM OPENQUERY([Manchester],
'SET NOCOUNT ON; EXEC [PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'',
''10/10/2009''')
尝试添加
设置FMTONLY OFF;不计数代码>在您的查询中
SELECT * INTO #temptable FROM OPENQUERY([Manchester], 'SET FMTONLY OFF; SET NOCOUNT ON; EXEC [Manchester]. [PilotWebApp].[DBO].rsp_HandheldPerformance ''10/01/2009'', ''10/10/2009''')
已经检查过了,没问题。就像我尝试在链接服务器上执行任何其他查询一样,默认目录设置是否正确?是否启用了“RPC Out”(存储过程调用需要它)?