SQL - 如何备份数据库并作为MDF文件导出为MS SQL 2008 R2 [英] SQL - How to backup a database and export as a MDF file with MS SQL 2008 R2
本文介绍了SQL - 如何备份数据库并作为MDF文件导出为MS SQL 2008 R2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个数据库测试与MS SQL Server 2008 R2中的一些表(即MS SQL Server Management Studio)。
I have created a database "test" with some tables in MS SQL Server 2008 R2 (i.e. MS SQL Server Management Studio).
现在,该数据库作为MDF文件。
Now, I need to export this database as a MDF file.
我应该怎么办?
推荐答案
p>如果您的意思是您希望能够在另一台服务器上附加数据库,则可以这样做:
If you mean that you want to be able to attach the database on another server, then this is what you can do:
- (右键单击数据库并单击
分离
) - 将mdf和ldf文件复制到备份位置
- 附加数据库(右键单击
数据库
,然后单击附加
)
- detach the database (right click the database and click
Detach
) - copy the mdf and ldf files to your backup location
- attach the database (right click
Databases
and clickAttach
)
这是您将找到MDF文件的路径:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\
这篇关于SQL - 如何备份数据库并作为MDF文件导出为MS SQL 2008 R2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文