如何将数据库从一台计算机复制到另一台计算机? [英] How to copy a database from one computer to another?

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

问题描述

我在SQL Server 2008中有一个数据库,我想将其复制到另一台计算机上。

I have a database in SQL Server 2008, which I want to copy to another computer.

如何进行这样的复制?

一旦完成,我应该在另一台计算机上从我的副本再次构建数据库吗?

Once this is done, what should I do at the other computer to build the database once again from my copy?

推荐答案

简单答案:将其备份,然后在另一台计算机上还原。

Simple Answer: Back it up, then restore it on the other computer.

在此处查看: http://technet.microsoft.com/en-us/library/cc966495.aspx

那里有很多东西,但是从本质上来说,右键单击数据库的任务>备份。填写选项以执行到某处的完整备份。

There's a lot of stuff there, but essentially, right click on the database, Tasks > Backup. Fill in the options to perform a full backup to somewhere.

一旦它在第二台计算机上创建了备份(一个大文件,按照惯例带有BAK扩展名)。 ,右键单击数据库文件夹,单击还原数据库,然后按照提示进行操作。

Once it has created the backup (one big file, by convention with a BAK extension), on the second computer, right click the Databases folder, Restore Database and follow the prompts.

如果愿意,您也可以在SQL中执行此操作:

You can do it as well in SQL if you wish:

  • Backup: http://msdn.microsoft.com/en-us/library/ms186865.aspx
  • Restore: http://msdn.microsoft.com/en-us/library/ms186858.aspx

有时可能最好分离和移动,但是这种方法总会感觉更安全!

There might be times when it's better to detach and move, but this approach always feels a bit safer!

这将复制结构和数据库中的数据。

This will copy both structure and the data in the database.

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

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