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

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

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

会有什么问题呢?


当前回答

我确定这个问题与文件和文件夹权限有关。

其他回答

首先创建一个同名的空白数据库。然后选择恢复选项

在左侧窗格的选项下,不要忘记选择

覆盖现有数据库 保留复制设置

就是这样

我确定这个问题与文件和文件夹权限有关。

USE [master];
GO

CREATE DATABASE db;
GO

CREATE DATABASE db2;
GO

BACKUP DATABASE db TO DISK = 'c:\temp\db.bak' WITH INIT, COMPRESSION;
GO

RESTORE DATABASE db2
  FROM DISK = 'c:\temp\db.bak'
  WITH REPLACE,
  MOVE 'db' TO 'c:\temp\db2.mdf',
  MOVE 'db_log' TO 'c:\temp\db2.ldf';

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

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

简单3步:

1-右键单击数据库→任务→恢复→数据库

2-检查设备作为源,并找到。bak(或压缩。bak)文件

3-在左侧窗格单击选项和:

check覆盖现有数据库。 恢复前进行尾日志备份 关闭到目标数据库的现有连接。

其他选项都是可选的(当然也很重要)!