将一个数据库的模式和数据复制到其他数据库 [英] Copy the schema and data of one database to other database

查看:80
本文介绍了将一个数据库的模式和数据复制到其他数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





请告诉我如何将一台服务器中的一个数据库的架构和数据复制到MS SQL中不同服务器上的其他数据库Server 2008R @。







提前致谢。

Hi,

Please enlighten me on how to copy the schema and data of one database which is in one server to other database present on different server in MS SQL Server 2008R@.



Thanks in advance.

推荐答案

看到类似的答案:搬家数据库从一个数据库表到另一个数据库表 [ ^ ]



我建议您使用复制数据库向导 [ ^ ]。



其他资源:

SQL SERVER - 将数据库从实例复制到另一个实例 - 在SQL Server中复制粘贴 [ ^ ]

SQL SERVER - 2008 - 使用数据复制数据库 - 生成用于将数据从一个表插入另一个表的T-SQL [ ^ ]

将数据库从一台服务器移动到SQL Server 2008中的另一台服务器 [ ^ ]
See similar answer: Moving Datas from One database Table to another database table[^]

I would suggest you to use Copy Database Wizard[^].

Other resources:
SQL SERVER – Copy Database from Instance to Another Instance – Copy Paste in SQL Server[^]
SQL SERVER – 2008 – Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table[^]
Move a database from one server to another server in SQL Server 2008[^]


看看这对你有用..



http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy- database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects / [ ^ ]
See if this works for you..

http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy-database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/[^]


创建链接服务器在您当前的服务器中,您希望在哪里提取数据...



然后在当前服务器中执行以下查询,无论您想要哪个数据库:



Create a linked server in your current server, where you want your data to be pulled...

Then execute the below query in your current server, whichever DB you want:

Insert into MyCurrentDB.Schema.TableName 
Select * from LinkedServer.RemoteServerDB.Schema.TableName with (nolock)





这应该可以解决问题。



您也可以在SSMS中尝试导入导出向导。



It should do the trick.

You can also try the Import Export Wizard in SSMS.


这篇关于将一个数据库的模式和数据复制到其他数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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