如何将Bak文件导入SQL Server Express [英] How to import a bak file into SQL Server Express
问题描述
我有一个 .bak
文件,并且我想使用此文件在SQL Server 2008 Management Studio的全新安装中重新创建数据库。
有人可以指出正确的方向吗?
我尝试过:
-
右键单击对象资源管理器中的数据库容器
-
从上下文菜单中选择还原数据库
-
指定到数据库为新数据库或现有数据库
-
指定源从设备还原
-
选择备份媒体作为文件
-
单击添加按钮并浏览到BAK文件的位置
但我收到了
的错误消息
服务器 MyServer-PC的还原失败。 (Microsoft.SqlServer.SmoExtended)
附加信息:
System.Data.SqlClient.SqlError:备份set保存除现有 invent数据库以外的数据库的备份。 (Microsoft.SqlServer.Smo)
有分步说明(带有图片) )@ @ 还原数据库
-
单击开始,选择所有程序,然后单击 Microsoft SQL Server 2008 ,然后选择 SQL Server Management Studio 。
这将弹出连接到服务器对话框。
确保服务器名称 YourServerName ,并且该 Authentication 设置为 Windows身份验证。
单击 Connect 。 p> -
在右侧,右键单击数据库,然后选择还原数据库。
这将打开还原数据库窗口。 -
在 还原数据库屏幕上 ong>,选择 From Device单选按钮,然后单击 ... 框。
这将弹出指定备份屏幕。 -
在指定备份屏幕上,单击添加。
这将调出查找备份文件。 -
选择 DBBackup文件夹,然后选择您的备份文件。
-
在还原数据库屏幕中,在选择要还原的备份集下:在数据旁边的还原框中和到数据库旁边的下拉列表中进行检查:选择DbName 。
-
您已完成。
I have a .bak
file, and I want to use this file to recreate the database in a fresh install of SQL Server 2008 Management Studio.
Can someone point me in the right direction on how this can be done?
I have tried:
right click on the Databases container within object explorer
from context menu select Restore database
Specify To Database as either a new or existing database
Specify Source for restore as from device
Select Backup media as File
Click the Add button and browse to the location of the BAK file
but I am getting error that
Restore failed for Server 'MyServer-PC'. (Microsoft.SqlServer.SmoExtended)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'invent' database. (Microsoft.SqlServer.Smo)
There is a step by step explanation (with pictures) available @ Restore DataBase
Click Start, select All Programs, click Microsoft SQL Server 2008 and select SQL Server Management Studio.
This will bring up the Connect to Server dialog box.
Ensure that the Server name YourServerName and that Authentication is set to Windows Authentication.
Click Connect.On the right, right-click Databases and select Restore Database.
This will bring up the Restore Database window.On the Restore Database screen, select the From Device radio button and click the "..." box.
This will bring up the Specify Backup screen.On the Specify Backup screen, click Add.
This will bring up the Locate Backup File.Select the DBBackup folder and chose your BackUp File(s).
On the Restore Database screen, under Select the backup sets to restore: place a check in the Restore box, next to your data and in the drop-down next to To database: select DbName.
You're done.
这篇关于如何将Bak文件导入SQL Server Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!