链接的SQL Server数据库提供“不一致的元数据"错误 [英] Linked SQL Server database giving "inconsistent metadata" error

查看:592
本文介绍了链接的SQL Server数据库提供“不一致的元数据"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在运行第三方软件套件,该套件使用SQL Server作为其数据库.我有另一个在不同位置运行的SQL Server实例,并且在该实例中构建的某些应用程序SQL Server需要访问第三方软件中的某些数据.因此,我在框之间创建了ODBC连接,并将第三方SQL Server设置为我的SQL Server版本上的链接服务器.作为测试,我从SQL Server中运行了以下语句,访问了第三方表之一:

I am currently running a third-party software suite, which uses SQL Server as its database. I have a second instance of SQL Server running in a different location, and some apps that I am building in that instance SQL Server needs to access some data in the third-party software. So, I created an ODBC connection between the boxes, and set up the third-party SQL server as a linked server on my version of SQL Server. As a test, I ran something like the following statement from my SQL server, accessing one of the third-party's tables:

SELECT * FROM LinkedServerName.SchemaName.dbo.TableName

我收到此错误的消息:

OLE DB error trace [Non-interface error:  Column 'TableRowVersion' (compile-time
ordinal 4) of object '"SchemaName"."dbo"."TableName"' was reported to have a
DBCOLUMNFLAGS_ISROWVER of 0 at compile time and 512 at run time].

Msg 7356, Level 16, State 1, Line 1

OLE DB provider 'MSDASQL' supplied inconsistent metadata for a column. Metadata
information was changed at execution time.

此错误与我尝试访问的任何其他表相同.该错误是什么意思,有没有解决的办法?

This error is the same for any other table I try to access. What does this error mean, and is there a way around it?

推荐答案

我已经发生过几次了.我发现的一种解决方法是使用OPENQUERY.

I've had this happen a few times. The one workaround I found was to use OPENQUERY.

SELECT * FROM OPENQUERY(LinkedServerName, 'SELECT * FROM DBName.Schema.Table')

此外,您在上方发布的选区的4个零件名称不正确(可能只是拼写错误,但我不确定).它应该是LinkedServerName.DBName.SchemaName.TableName

Also, the select you posted above has an incorrect 4 part name (could just be a typo but I wasn't sure). It should be LinkedServerName.DBName.SchemaName.TableName

这篇关于链接的SQL Server数据库提供“不一致的元数据"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆