如何在一个 SQL 查询中连接来自两个不同 SQL Server 实例的表
可能的重复:
从 SQL Server 中的两个不同服务器中选择数据 < /p>
如何我可以在一个查询中连接位于两个不同 SQL Server 实例的两个表吗?
Possible Duplicate:
Selecting data from two different servers in SQL Server
How can I join two tables, which are located two different SQL Server instances, in one query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我能想到的实现此目的的最佳方法是通过 sp_addlinkedserver。您需要确保使用任何帐户添加链接(通过 sp_addlinkedsrvlogin) 对您要加入的表具有权限,但是一旦建立链接,您就可以通过名称调用服务器,即:
The best way I can think of to accomplish this is via sp_addlinkedserver. You need to make sure that whatever account you use to add the link (via sp_addlinkedsrvlogin) has permissions to the table you're joining, but then once the link is established, you can call the server by name, i.e.:
您可以创建链接服务器并引用另一个实例中的表使用其完全限定的 Server.Catalog.Schema.Table 名称。
You can create a linked server and reference the table in the other instance using its fully qualified Server.Catalog.Schema.Table name.
如果您使用 SQL Server,请尝试链接服务器
If you are using SQL Server try Linked Server