链接服务器的 OLE DB 提供程序报告架构版本发生更改错误 [英] OLE DB provider for linked server reported a change in schema version Error
问题描述
我有一项夜间工作,即通过执行存储过程来更新表,但它每 2-3 天就会失败一次.
I have a nightly job which is updates table by executing stored procedure but it keeps failing every 2-3 days.
DECLARE @return_value int
EXEC @return_value = [dbo].[sp_SRA_Analysis_Union]
SELECT 'Return Value' = @return_value
以下是错误信息:
Step Name update table
Duration 00:00:30
Sql Severity 16
Sql Message ID 7359
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: NT AUTHORITYSYSTEM.
The OLE DB provider "SQLNCLI10" for linked server "SQL05"
reported a change in schema version between
compile time ("182390105529348") and
run time ("182402990418943") for table "dbo"."CL_Midpoint"".
[SQLSTATE 42000] (Error 7359). The step failed.
任何想法/建议如何避免这种情况?
Any idea/suggestions how to avoid this?
谢谢,增强现实
推荐答案
今天遇到了完全相同的错误.做了一些研究,发现:https://support.microsoft.com/en-us/kb/2498818
Got the exact same error today. Did some research and found this: https://support.microsoft.com/en-us/kb/2498818
在使用链接服务器以及引用链接服务器的同义词/别名和/或视图时,这似乎是一个错误.在我们的例子中,我们有一个从 SQL Server 2014 到 SQL Server 2008R2 的链接服务器.在使用链接服务器访问的表上运行了重新索引操作(并且查询使用链接服务器资产的表别名),我们收到此错误.
It appears to be a bug while using a linked server and synonym/aliases and/or views that refer to the linked server. In our case we had a linked server from SQL Server 2014 to SQL Server 2008R2. A reindex operation was run on a table that was being accessed using linked server (and the query was using a table alias for the linked server asset), we got this error.
有两件事对我有用:1.重新运行SP,它工作正常.2.删除了SP查询中的表别名,也解决了以后的问题.
Two things worked for me: 1. Just re-ran the SP and it worked fine. 2. Removed the table alias in the SP query and that resolved the issue for future too.
这篇关于链接服务器的 OLE DB 提供程序报告架构版本发生更改错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!