简体   繁体   中英

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. Any pointers to this will be really helpful.

Create a linked server or use Openrowset to create a connection with remote server.

use linked server if you need to perform routine task with remote server else use openrowset.

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:

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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