gpt4 book ai didi

sql-server - MSSQL 链接服务器错误 : The OLE DB provider "OraOLEDB.Oracle" for linked server supplied inconsistent metadata for a column

转载 作者:行者123 更新时间:2023-12-04 00:35:45 26 4
gpt4 key购买 nike

我试图将数据从 Oracle 拉到 MSSqlserver使用链接服务器的数据库。

select * from [LINK_NAME]..SCHEMA.TABLE;

但它因以下错误而失败:

The OLE DB provider "OraOLEDB.Oracle" for linked server "LINK_NAME" supplied inconsistent metadata for a column. The column "COLUMN_NAME" (compile-time ordinal 6) of object ""SCHEMA"."TABLE"" was reported to have a "LENGTH" of 100 at compile time and 200 at run time.



我还需要在运行时在 where 条件下传递参数。我发现 OPENQUERY 作为解决方案,但它在运行时不支持参数。

最佳答案

尝试使用 OPENQUERY 语法看看是否有帮助..

SELECT * FROM OPENQUERY(LINK_NAME, 'SELECT * FROM db.Schema.Table')

更多关于 OPENQUERY ...

关于sql-server - MSSQL 链接服务器错误 : The OLE DB provider "OraOLEDB.Oracle" for linked server supplied inconsistent metadata for a column,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37658253/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com