链接服务器的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 AUTHORITY\SYSTEM.
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?
谢谢, AR
推荐答案
今天获得了完全相同的错误.经过研究后发现: 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屋!