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

前端 未结 5 558
旧巷少年郎
旧巷少年郎 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:07

    Even if you have named a column incorrectly in your query, you are going to see this error. Example:

    select *
    from openquery(
         lnksrv
        ,'select top 10 * from db.schema.table where colunm = 10'
    )
    

    and the column name is column, not colunm.

    Bottom line is check the actual query to be sent to the remote server for correctness first, then wrap it in openquery and re-test.

提交回复
热议问题