0
votes

I'm currently trying to restore my database.

The step I follow is the executing the query

Restore Database vaio 
from disk = 'C:\Users\DB101209123928_Diff_20120312.bak'
with replace;

But I'm getting the following error.

Msg 3154, Level 16, State 4, Line 1
The backup set holds a backup of a database other than the existing 'vaio' database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

3

3 Answers

3
votes

You can try this query first to see what's contained in your .bak file:

DECLARE @FileName NVARCHAR(255)
SET @FileName = N'C:\Users\DB101209123928_Diff_20120312.bak' 

RESTORE FILELISTONLY
FROM DISK = @FileName

Once you know what's in the backup file, you can then restore the appropriate database from it.

2
votes

The error says that there is no database named vaioin your restore file.

There is not much to help here. Make sure you have the correct restore file

0
votes

First check header by below query,

restore headeronly from disk ='D:\anuj\userpro.bak'

It will give you information like: database name, backup name, position, username...

Now execute the following commands to restore database:

restore database school from disk='D:\anuj\school.bak' with file =1

Here, replace file =1 is the position given by above query.