如何将数据从一个数据库传输到另一个数据库?

编程入门 行业动态 更新时间:2024-10-23 07:18:42
本文介绍了如何将数据从一个数据库传输到另一个数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有SQL数据库专用服务器,其中AA数据库是300GB(20 GB mdf和280 GB ldf)文件。我在本地系统上创建了具有相同名称的数据库。我只想从服务器数据库中获取具有外键关系的数据。我怎样才能做到这一点。我已尝试使用SQL服务器中的导入/导出选项,因为外键关系无法插入行。 我尝试使用导入数据库选项,但没有标识值就成功了。 我不想让我的数据库中表格的任何标识值不匹配。 有没有办法做到这一点? 请帮我解决这个问题。 先谢谢

解决方案

SQL Server表模式和数据来自一个数据库到另一个数据库 为此请参阅以下文章 将表格模式和数据从一个数据库复制到SQL Server中的另一个数据库 [ ^ ] web.synametrics/IDataExpWiz.htm [ ^ ]

身份确实有点棘手(这是不使用身份的原因),但这并不困难。 这是一次性的努力吗?在哪种情况下SSMS可以做到这一点。 或定期努力?在这种情况下,你可能想要使用SSIS。 两者都可以被告知要复制身份。

我推荐SSIS 。 浏览链接并执行此操作 HTTP:// awesomesql .wordpress / 2009/08/18 /复制所有的对象从 - 一个数据库到另一个功能于使用传输-SQL服务器对象任务SSIS-/ [ ^ ] 希望这会对你有所帮助

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[^] web.synametrics/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 awesomesql.wordpress/2009/08/18/copy-all-objects-from-one-database-to-another-in-ssis-using-transfer-sql-server-objects-task/[^] Hope this will help you

更多推荐

如何将数据从一个数据库传输到另一个数据库?

本文发布于:2023-10-16 16:41:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498142.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   如何将   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!