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

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

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

会有什么问题呢?


当前回答

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

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

其他回答

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

通常处理.bak文件会让人头疼,一种更直接的方法是使用sqldump文件来传输数据库。

生成要移动或复制的当前数据库的脚本。 选择All Tables,而不是整个数据库。 从选项菜单中选择另存为脚本,然后单击高级按钮并设置以下配置(我正在起诉MSSQL 2016): 现在,在你想导入这些数据的地方,创建一个新数据库,切换到这个新数据库(我的意思是设置为默认值) 最后运行脚本,将导入所有表和数据。

祝你好运。

列表项

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

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

我只是想解决这个问题。

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

希望这能帮助到其他人。

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

这在我的SQL服务器上工作