如何将数据从一个SQL Server移动到另一个SQL Server?

时间:2021-04-09 12:58:57

I want to copy all my database to remote database server. I have access to server using SQL server management studio.

我想将我的所有数据库复制到远程数据库服务器。我可以使用SQL Server管理工作室访问服务器。

How can I do this? I have created script with data of old database and tried to run it on new server but it is taking too much time and returns different errors like duplicate key etc.

我怎样才能做到这一点?我用旧数据库的数据创建了脚本,并尝试在新服务器上运行它但是它花费了太多时间并返回不同的错误,如重复键等。

3 个解决方案

#1


1  

Assuming that you can restore databases to your remote SQL server, you can use SQL Server backup and restore? They're available in SQL Server Management Studio. See http://msdn.microsoft.com/en-us/library/ms187510.aspx. It's very easy to use.

假设您可以将数据库还原到远程SQL Server,您可以使用SQL Server备份和还原吗?它们在SQL Server Management Studio中可用。请参阅http://msdn.microsoft.com/en-us/library/ms187510.aspx。它非常易于使用。

Other than that, you can try copying the database MDF and LDF files from your local database onto your remote database filesystem, then attaching to the MDF file on your remote database.

除此之外,您可以尝试将数据库MDF和LDF文件从本地数据库复制到远程数据库文件系统,然后附加到远程数据库上的MDF文件。

Those are probably the fastest ways that you can copy and entire database to a remote location that I can think of.

这些可能是您可以将整个数据库复制到我能想到的远程位置的最快方法。

#2


2  

If this is a one time deal, you should download Redgate's SQL tools. They can handle this easily and are free to test for 14 days I believe. (http://www.red-gate.com) You might even find they are worth the purchase as I have. The tools you would use are SQL Compare (to copy structure) and SQL DAta Compare to actually copy the data.

如果这是一次性交易,您应该下载Redgate的SQL工具。他们可以很容易地处理这个问题,我相信可以*测试14天。 (http://www.red-gate.com)您甚至可能会发现它们值得我购买。您将使用的工具是SQL Compare(复制结构)和SQL DAta比较以实际复制数据。

#3


0  

Try Database publishing wizard by Microsoft. Good enough for no very big data amounts.

尝试Microsoft的数据库发布向导。足够好,没有非常大的数据量。

#1


1  

Assuming that you can restore databases to your remote SQL server, you can use SQL Server backup and restore? They're available in SQL Server Management Studio. See http://msdn.microsoft.com/en-us/library/ms187510.aspx. It's very easy to use.

假设您可以将数据库还原到远程SQL Server,您可以使用SQL Server备份和还原吗?它们在SQL Server Management Studio中可用。请参阅http://msdn.microsoft.com/en-us/library/ms187510.aspx。它非常易于使用。

Other than that, you can try copying the database MDF and LDF files from your local database onto your remote database filesystem, then attaching to the MDF file on your remote database.

除此之外,您可以尝试将数据库MDF和LDF文件从本地数据库复制到远程数据库文件系统,然后附加到远程数据库上的MDF文件。

Those are probably the fastest ways that you can copy and entire database to a remote location that I can think of.

这些可能是您可以将整个数据库复制到我能想到的远程位置的最快方法。

#2


2  

If this is a one time deal, you should download Redgate's SQL tools. They can handle this easily and are free to test for 14 days I believe. (http://www.red-gate.com) You might even find they are worth the purchase as I have. The tools you would use are SQL Compare (to copy structure) and SQL DAta Compare to actually copy the data.

如果这是一次性交易,您应该下载Redgate的SQL工具。他们可以很容易地处理这个问题,我相信可以*测试14天。 (http://www.red-gate.com)您甚至可能会发现它们值得我购买。您将使用的工具是SQL Compare(复制结构)和SQL DAta比较以实际复制数据。

#3


0  

Try Database publishing wizard by Microsoft. Good enough for no very big data amounts.

尝试Microsoft的数据库发布向导。足够好,没有非常大的数据量。