如何将数据从一个数据库传输到另一个数据库? [英] How do I Transfer Data From One Database to Another?

查看:375
本文介绍了如何将数据从一个数据库传输到另一个数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有SQL数据库专用服务器,其中AA数据库是300GB(20 GB mdf和280 GB ldf)文件。我在本地系统上创建了具有相同名称的数据库。我只想从服务器数据库中获取具有外键关系的数据。我怎样才能做到这一点。我已尝试使用SQL服务器中的导入/导出选项,因为外键关系无法插入行。

我尝试使用导入数据库选项,但没有标识值就成功了。

我不想让我的数据库中表格的任何标识值不匹配。



有没有办法做到这一点?



请帮我解决这个问题。

先谢谢

解决方案

SQL Server表模式和数据来自一个数据库到另一个数据库

为此请参阅以下文章

将表格模式和数据从一个数据库复制到SQL Server中的另一个数据库 [ ^ ]

http://web.synametrics.com/IDataExpWiz.htm [ ^ ]


身份确实有点棘手(这是不使用身份的原因),但这并不困难。



这是一次性的努力吗?在哪种情况下SSMS可以做到这一点。

或定期努力?在这种情况下,你可能想要使用SSIS。



两者都可以被告知要复制身份。


我推荐SSIS 。



浏览链接并执行此操作



HTTP:// awesomesql .wordpress.com / 2009/08/18 /复制所有的对象从 - 一个数据库到另一个功能于使用传输-SQL服务器对象任务SSIS-/ [<一个HREF =http://awesomesql.wordpress.com/2009/08/18/copy-all-objects-from-one-database-to-another-in-ssis-using-transfer-sql-server-objects-task /target =_ blanktitle =新窗口> ^ ]





希望这会对你有所帮助

I have SQL database dedicated server on on which "AA" databse is of 300GB (20 GB mdf and 280 GB ldf) files. I have created databse with same name on my local system. I wanted to take only data from Server Database with foreign key relations. How can I do this. I have tried with Import/Export option in SQL server not able to insert rows because of Foreign key relation.
I have tried with import database option it is successful without Identity values.
I don't want to mismatch any Identity value of tables in my database.

Is there any way to do this?

Please help me to solve this.
Thanks In Advance

解决方案

SQL Server table schema and data from one database to another database.
For this See the following article
Copy Table Schema and Data From One Database to Another Database in SQL Server[^]
http://web.synametrics.com/IDataExpWiz.htm[^]


Identities do make that a little tricky (which is a reason not to use identities), but it's not difficult.

Is this a one-time effort? In which case SSMS can do it.
Or a periodic effort? In which case you may want to use SSIS.

Both can be told to copy the identities.


I would recommend SSIS.

Go through the link and do it

http://awesomesql.wordpress.com/2009/08/18/copy-all-objects-from-one-database-to-another-in-ssis-using-transfer-sql-server-objects-task/[^]


Hope this will help you


这篇关于如何将数据从一个数据库传输到另一个数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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