我试图恢复我的数据库的SQL Server备份文件,但它抛出一个错误如下:

备份集保存现有数据库以外的数据库的备份

我的数据库是SQL Server 2008,备份文件是2005年的。

会有什么问题呢?


当前回答

而不是点击恢复数据库点击恢复文件和文件组..

这在我的SQL服务器上工作

其他回答

我也面临同样的问题,并通过这样做找到了解决方案,使用SSMS 2014

Just select the Option Overwrite the existing database(WITH REPLACE) 

我通过另一种方式完成工作,使用生成脚本。这对我来说确实有用,因为由于同样的错误,Backup-Restore没有帮助解决这个问题。

这帮助我从系统驱动器导入备份文件

Create a database with the same name(preferably) as your .bak file database name Right click the database > Tasks > Restore > Database Under "Source for restore" select "From Device" Select the .bak file selecting the path from the system Select the check box for the database in the list box below Under "Select a Page" on the right Select "Options" Select the checkbox labeled "Preserve the replication settings(WITH KEEP_REPLICATION) Select the checkbox for Overwrite the existing database(WITH REPLACE) Now Go back to the General page and click OK to restore the database...

有些人把这个问题看得太复杂了。我发现这非常简单。

1)创建一个与你的.bak文件数据库名称相同的数据库

2)右键单击数据库| Tasks >恢复>数据库

3)在“还原源”下选择“从设备”

4)选择“。bak”文件

5)在下面的网格视图中选中数据库对应的复选框

6)在右侧的“选择页面”下选择“选项”

7)选中“保留复制设置(WITH KEEP_REPLICATION)”复选框

现在返回到General页面,单击OK恢复数据库…就是这样。

我只是想解决这个问题。

从以管理员身份运行到这里和其他地方找到的建议,我尝试了所有方法;为我解决这个问题的是在文件属性选项卡中检查“重新安置文件”选项。

希望这能帮助到其他人。