如何将Bak文件导入SQL Server Express [英] How to import a bak file into SQL Server Express

查看:202
本文介绍了如何将Bak文件导入SQL Server Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .bak 文件,并且我想使用此文件在SQL Server 2008 Management Studio的全新安装中重新创建数据库。



有人可以指出正确的方向吗?



我尝试过:


  1. 右键单击对象资源管理器中的数据库容器


  2. 从上下文菜单中选择还原数据库


  3. 指定到数据库为新数据库或现有数据库


  4. 指定源从设备还原


  5. 选择备份媒体作为文件


  6. 单击添加按钮并浏览到BAK文件的位置


但我收到了


的错误消息


服务器 MyServer-PC的还原失败。 (Microsoft.SqlServer.SmoExtended)



附加信息:



System.Data.SqlClient.SqlError:备份set保存除现有 invent数据库以外的数据库的备份。 (Microsoft.SqlServer.Smo)



解决方案

有分步说明(带有图片) )@ @ 还原数据库


  1. 单击开始,选择所有程序,然后单击 Microsoft SQL Server 2008 ,然后选择 SQL Server Management Studio

    这将弹出连接到服务器对话框。

    确保服务器名称 YourServerName ,并且该 Authentication 设置为 Windows身份验证

    单击 Connect 。 p>


  2. 在右侧,右键单击数据库,然后选择还原数据库

    这将打开还原数据库窗口


  3. 还原数据库屏幕上 ong>,选择 From Device单选按钮,然后单击 ... 框。

    这将弹出指定备份屏幕


  4. 指定备份屏幕上,单击添加

    这将调出查找备份文件


  5. 选择 DBBackup文件夹,然后选择您的备份文件。


  6. 还原数据库屏幕中,在选择要还原的备份集下:在数据旁边的还原框中和到数据库旁边的下拉列表中进行检查:选择DbName


  7. 您已完成。



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:

  1. right click on the Databases container within object explorer

  2. from context menu select Restore database

  3. Specify To Database as either a new or existing database

  4. Specify Source for restore as from device

  5. Select Backup media as File

  6. 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

  1. 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.

  2. On the right, right-click Databases and select Restore Database.
    This will bring up the Restore Database window.

  3. On the Restore Database screen, select the From Device radio button and click the "..." box.
    This will bring up the Specify Backup screen.

  4. On the Specify Backup screen, click Add.
    This will bring up the Locate Backup File.

  5. Select the DBBackup folder and chose your BackUp File(s).

  6. 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.

  7. You're done.

这篇关于如何将Bak文件导入SQL Server Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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