“Deferred prepare could not be completed” error when using local database as linked server

前端 未结 5 566
旧巷少年郎
旧巷少年郎 2021-01-17 07:49

I created a Linked Server from my local Sql Server, as given in

http://sqlserverplanet.com/dba/local-linked-server

However when I try to execute a stored pro

5条回答
  •  不知归路
    2021-01-17 08:04

    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
    

    Check with options like SET FMTONLY OFF when executing Stored procedure.

    Follow this link for OPENQUERY: http://msdn.microsoft.com/en-us/library/ms188427.aspx

提交回复
热议问题