“无法完成延迟的准备".使用本地数据库作为链接服务器时出错 [英] "Deferred prepare could not be completed" error when using local database as linked server
问题描述
我从本地Sql Server创建了一个链接服务器,如
I created a Linked Server from my local Sql Server, as given in
http://sqlserverplanet.com/dba/local-linked-server
但是,当我尝试在Linked Server中执行存储过程时,它会抛出:
However when I try to execute a stored procedure in Linked Server, it throws:
Deferred prepare could not be completed
错误和无效的对象名称表名称"
error and invalid object name 'table name'
推荐答案
您是否错过了对象名称中的某些内容.它应该始终像Database.User.ObjectName(例如Northwind.dbo.Customers)
Have you missed something in your object name. It should be always like Database.User.ObjectName (for e.g. Northwind.dbo.Customers)
在通过链接服务器运行查询时提供完整的对象名称.
Give complete object name when running queries via Linked servers.
在链接服务器上执行时查询存储过程可能是这样的:
Query for Stored Procedure may be like this when executing on Linked Servers:
Select *
From OPENQUERY([COM2\SQLEXPRESS], 'Exec Northwind.dbo.CustOrderHist ''CUST1''') as TB1
在执行存储过程时,请使用SET FMTONLY OFF之类的选项进行检查.
Check with options like SET FMTONLY OFF when executing Stored procedure.
按照OPENQUERY的此链接进行操作: http://msdn.microsoft.com/en-us/library /ms188427.aspx
Follow this link for OPENQUERY: http://msdn.microsoft.com/en-us/library/ms188427.aspx
这篇关于“无法完成延迟的准备".使用本地数据库作为链接服务器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!