简体   繁体   English

使用链接服务器返回错误-“无法获取OLE DB提供程序的架构行集”

[英]Using linked server returns error - “Cannot obtain the schema rowset for OLE DB provider”

I tried to move data aka ETL from one sql server to another as mentioned in a previous question - Copy data from one column into another column . 如上一个问题所述,我试图将ETL数据从一台sql服务器移动到另一台sql服务器- 将数据从一列复制到另一列 Now, I get an error when I try to execute a query. 现在,当我尝试执行查询时出现错误。

Query - 查询-

INSERT INTO [Target_server].[Target_DB1].[dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'

Error - 错误-

OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER" returned message "Unspecified error".
OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "MYLINKEDSERVER". The provider supports the interface, but returns a failure code when it is used.

If your wrote that simple select is not working, the issue is in security configuration of the linked server and permissions which your user receive there. 如果您写的简单选择不起作用,则问题出在链接服务器的安全配置和用户在此处获得的权限。

Among this, when you execution your query, you don't need to specify the server name and DB name for both parts - source and target. 其中,执行查询时,无需为源和目标这两个部分都指定服务器名称和数据库名称。 You simply need to execute the query on target server and target database. 您只需要在目标服务器和目标数据库上执行查询。 In this case your query instead of 在这种情况下,您的查询而不是

INSERT INTO [Target_server].[Target_DB1].[dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'

will looks like the following: 将如下所示:

INSERT INTO [dbo].[Target_Table1](Target_Column1)
SELECT Source_Column222
FROM [Source_server].[Source_DB1].[dbo].[Source_Table1]
WHERE Source_Column1 = 'ID7162'

and you need your connection to be opened on server [Target_server] and database [Target_DB1] . 并且您需要在服务器[Target_server]和数据库[Target_DB1]上打开连接。 Also the linked server security properties need to be checked on [Target_server] against the [Source_server] . 另外,链接服务器的安全性需要对被检查[Target_server]反对[Source_server]

If you are using loop back linked server (linked server refering to the same database in the same server) then refer the below mentioned link: 如果您正在使用回送链接服务器(链接服务器引用同一服务器中的同一数据库),则请参考以下链接:

Transaction with loopback linked server - locking issues 与环回链接服务器进行事务处理-锁定问题

If that is not the case, this is the solution provided by Microsoft. 如果不是这种情况,则是Microsoft提供的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接服务器的OLE DB提供程序报告了架构版本错误 - OLE DB provider for linked server reported a change in schema version Error 链接服务器无法初始化 OLE DB 提供程序的数据源对象 - Linked server Cannot initialize the data source object of OLE DB provider 错误:无法从OLE DB提供程序“ADsDSOObject”获取链接服务器“ADSI”的行 - Error : Cannot fetch a row from OLE DB provider “ADsDSOObject” for linked server “ADSI” 链接服务器“(null)”的OLE DB提供程序“ MSDASQL”报告错误 - The OLE DB provider “MSDASQL” for linked server “(null)” reported an error 如何修复错误“灾难性故障。无法从链接服务器的 OLE DB 提供程序“OraOLEDB.Oracle”获取行” - How to fix error "Catastrophic failure. Cannot fetch a row from OLE DB provider "OraOLEDB.Oracle" for linked server" 链接服务器“(null)”的 OLE DB 提供程序“MSDASQL”无法更新表“[MSDASQL]”。 Pervasive 的未知提供程序错误 - The OLE DB provider "MSDASQL" for linked server "(null)" could not UPDATE table "[MSDASQL]". Unknown provider error with Pervasive 无法为链接服务器创建 OLE DB 提供程序 Microsoft.Jet.OLEDB.4.0 的实例 null - Cannot create an instance of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server null 无法为链接服务器初始化OLE DB提供程序“ Microsoft.ACE.OLEDB.12.0”的数据源对象 - Cannot initialize the data source object of OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server 错误:链接服务器“bquick”的 OLE DB 提供程序“MSDASQL”无法开始分布式事务 - Error: OLE DB provider "MSDASQL'' for Linked Server ''bequick'' was unable to begin a Distributed transaction 链接服务器“(null)”的 OLE DB 提供程序“Microsoft.Jet.OLEDB.4.0”报告错误 - The OLE DB provider “Microsoft.Jet.OLEDB.4.0” for linked server “(null)” reported an error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM