Reputation: 2311
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.
Upvotes: 0
Views: 2198
Reputation: 1
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.
Upvotes: 0
Reputation: 754488
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.
Upvotes: 3
Reputation: 204766
The error says that there is no database named vaio
in your restore file.
There is not much to help here. Make sure you have the correct restore file
Upvotes: 2