如何复制SQL数据库 [英] How to Copy SQL Database

查看:271
本文介绍了如何复制SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要将数据库从sql2000复制到另一个系统.我尝试使用生成脚本"选项,但它仅复制了所有表的数据库结构.但是我需要将表与输入的数据一起复制.我该怎么做?

Hi,

I need to copy a database from sql2000 to another system. I tried using Generate scripts option but it only copied the database structure with all the tables. But I need to copy the tables along with the data that has been entered. How do i do this?

推荐答案

sp_generate_inserts不是SQL的标准安装.您可以在此处找到它.<
sp_generate_inserts is not standard installed with SQL. You can find it here[^].

PS.
aspdotnetdev did also include this link.


请点击以下链接:
如何通过使用SQL Server中的分离和附加功能将SQL Server数据库移动到新位置 [^ ]
SQL Server数据库复制工具 [ ^ ]
了解SQL Server 2000中的复制数据库向导并对其进行故障排除 [ ^ ]
如何在运行SQL Server的计算机之间移动数据库 [ ^ ]
Please follow the links:
How to move SQL Server databases to a new location by using Detach and Attach functions in SQL Server[^]
SQL Server Database Copy Tool[^]
Understanding and troubleshooting the Copy Database Wizard in SQL Server 2000[^]
How to move databases between computers that are running SQL Server[^]


我发现 sp_generate_inserts 是一种将数据从一个系统复制到另一个系统的快速而肮脏的方法.它只是一个存储过程,可以从一个数据库中的数据生成INSERT语句,因此您可以在另一个数据库中执行这些INSERT.生成数据库的结构后,只需使用该存储过程即可复制数据.用法示例:
I''ve found sp_generate_inserts to be a quick and dirty way of copying data from one system to another. It''s just a stored procedure that generates INSERT statements from the data in one database so you can execute those INSERTs in another database. Once you generate the structure of the database, you''d just need to use that stored procedure to copy over the data. Example usage:
EXEC sp_generate_inserts 'MyFirstTable'
EXEC sp_generate_inserts 'MySecondTable'


这篇关于如何复制SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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