简体   繁体   English

将特定表数据从一个数据库复制到SQL Server中的另一个数据库

[英]Copy specific table data from one database to another in SQL Server

I need to copy specific data from select set of tables in one SQL Server to another SQL Server. 我需要将特定数据从一个SQL Server中的选定表集中复制到另一个SQL Server。 Any pointers to this will be really helpful. 对此的任何指示将非常有帮助。

Create a linked server or use Openrowset to create a connection with remote server. 创建链接服务器或使用Openrowset创建与远程服务器的连接。

use linked server if you need to perform routine task with remote server else use openrowset. 如果需要对远程服务器执行例行任务,请使用链接服务器,否则请使用openrowset。

http://msdn.microsoft.com/en-us/library/ms190479.aspx http://msdn.microsoft.com/en-us/library/ms190479.aspx

See this also 也看到这个

还有一个SSIS向导,又名SQL Server导入/导出向导,而不是完整的表副本,而是指定源查询,保存到磁盘(假设您需要定期重新运行该过程),瞧,将数据复制到一个盒子中

you can copy data from one database to another. 您可以将数据从一个数据库复制到另一个数据库。 The mysql query is: mysql查询是:

insert into database2.table_name2(field name) 
select table_name1.field_name from table_name1 
    where table_name1.field_name = condition

The above mysql query is used for copy specific data between databases. 上面的mysql查询用于在数据库之间复制特定的数据。 Suppose you want to copy whole table datd, then you will use following query: 假设您要复制整个表的数据,那么您将使用以下查询:

insert into database2.table_name2(field name) 
select table_name1.field_name from table_name1

You can move data to another table, or you can create a table based on the other table. 您可以将数据移动到另一个表,也可以基于另一个表创建一个表。 Your question is a good one that I have heard before so I wrote a quick blog post explaining the options 您的问题是我之前听过的一个好问题,因此我写了一篇简短的博客文章解释了这些选项

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

相关问题 SQL Server将数据从一个数据库表复制到另一数据库表 - Sql Server copy data from one database table to another 我可以将数据从一个数据库表复制到另一个已经存在的数据库表sql服务器吗? - Can i copy data from one database table to another already existing database table sql server? 如何使用SQL Server将表和数据从一个数据库复制到另一个数据库 - How to copy table and data from one database to another database using SQL Server 将表数据从一个数据库复制到另一个数据库SQL - Copy a table data from one database to another database SQL SQL Server:将列数据值从一个表复制到同一数据库中的另一表 - SQL Server: copy column data values from one table to another table in the same database 在 SQL 服务器中将 Partial Table 从一个数据库复制到另一个数据库 - Copy Partial Table from one database to another in SQL Server 使用SQL Server将数据从一个表复制到另一表 - Copy data from one table to another table using sql server 在sql中将特定数据从一个表复制到另一个表 - Copy specific data from one table to another in sql 将数据从一个表复制到SQL Server中的另一个表 - Copy data from one table to another in sql server 将所选数据从一个表复制到SQL Server中的另一个表 - Copy selected data from one table to another in SQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM