简体   繁体   English

查询多个数据库系统

[英]Querying multiple database systems

Is it possible to query (or better, join) data from two different database systems? 是否可以查询(或更好地联接)来自两个不同数据库系统的数据? Let's say I have postgresql and SQL Server and I want to join a table from postgres to a table in SQL Server? 假设我有postgresql和SQL Server,并且想将一个表从postgres连接到SQL Server中的表?

It doesn't matter which programming language. 哪种编程语言都没有关系。

What about utilizing a linked server? 如何利用链接服务器? I use one to query an AS400 and join the results back to Microsoft SQL Server. 我用一个查询一台AS400,并将结果联接回Microsoft SQL Server。

Quote from Microsoft documentation : 引用Microsoft文档

Configure a linked server to enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL Server. 配置链接服务器以使SQL Server数据库引擎能够对SQL Server实例外部的OLE DB数据源执行命令。 Typically linked servers are configured to enable the Database Engine to execute a Transact-SQL statement that includes tables in another instance of SQL Server, or another database product such as Oracle. 通常,链接服务器配置为使数据库引擎能够执行Transact-SQL语句,该语句包括SQL Server的另一个实例或另一个数据库产品(如Oracle)中的表。 Many types OLE DB data sources can be configured as linked servers, including Microsoft Access and Excel. 可以将许多类型的OLE DB数据源配置为链接服务器,包括Microsoft Access和Excel。 Linked servers offer the following advantages: 链接服务器具有以下优点:

  • The ability to access data from outside of SQL Server. 从SQL Server外部访问数据的能力。
  • The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise. 能够在整个企业的异构数据源上发出分布式查询,更新,命令和事务。
  • The ability to address diverse data sources similarly. 类似地处理各种数据源的能力。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM