简体   繁体   English

使用T-SQL脚本将数据从一台服务器复制到另一台服务器吗?

[英]T-SQL Script to copy data from one server to another?

Is it possible to copy data from one server to another using a T-SQL script? 是否可以使用T-SQL脚本将数据从一台服务器复制到另一台服务器? We have a code promotion process that makes using the import wizard less than optimal for our team so I am looking into a script I can simply have someone run in Management Studio that will do the trick. 我们有一个代码升级过程,该过程使导入向导的使用对于我们的团队而言并非最佳选择,因此我正在研究一个脚本,我可以简单地让某个人在Management Studio中运行以完成此任务。

Yes, First create a Linked Server to other server, then you can access the target server by 4 part Names, for example: 是的,首先创建一个Linked Server到其他服务器,然后可以通过4个部分的名称来访问目标服务器,例如:

Insert into Server2.Database2.dbo.MapTable1 select * from table1

ps you can add linked server by sp_addLinkedServer ps可以通过sp_addLinkedServer添加链接的服务器

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

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