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

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

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

会有什么问题呢?


当前回答

在执行其他操作之前,请确认备份是全量备份还是差动备份。如果您试图从差异备份中创建一个新数据库,那么无论您做什么,都会遇到错误。

其他回答

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

这在我的SQL服务器上工作

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

在选项中,将“还原为”文件名称更改为新的数据库mdf和ldf。它引用源数据库的.mdf和.ldf文件。

:

1)在使用RESTORE命令时使用WITH REPLACE(如果使用GUI,则在Options ->覆盖现有数据库(WITH REPLACE))。

2)删除冲突的旧数据库,使用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...