使用存储过程/触发器将数据从1个远程数据库复制到sql server中的另一个数据库 [英] using stored procedure/trigger copy data from 1 remote db to another in sql server

查看:249
本文介绍了使用存储过程/触发器将数据从1个远程数据库复制到sql server中的另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从远程服务器(Server1)中的一个数据库(DB1)收集数据到另一个远程服务器(Server2)中的另一个数据库(DB2)。



我有2个建议:使用openrowset和链接服务器

I want to collect data from one database(DB1) in a remote server(Server1) to another database(DB2) that is also in another remote server(Server2).

I got 2 suggestions : using openrowset , and linked server

推荐答案

Openrowset是性能影响选项。使用链接服务器。 sp_addlinkedserver将帮助您添加链接服务器,您可以在查询中的DB.TableName之前继续使用servername



Openrowset is performance impact option. use linked server. sp_addlinkedserver will help you to add the link server and you can proceed the servername before DB.TableName in the query

select * into server1.DB1.dbo.Targettable from server2.DB2.dbo.SourceTable


问题是因为远程服务器上未启用TCP / IP。



http://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/ [ ^ ]



尝试以上步骤解决此问题。
The issue is because TCP/IP is not enabled on the remote server.

http://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/[^]

Try the above steps to resolve this issue.


这篇关于使用存储过程/触发器将数据从1个远程数据库复制到sql server中的另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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