Showing posts with label The backup set holds a backup of a database other than the existing database.. Show all posts
Showing posts with label The backup set holds a backup of a database other than the existing database.. Show all posts

Saturday, 3 November 2012

The backup set holds a backup of a database other than the existing database

The backup set holds a backup of a database other than the existing database.


Solution:


I have solved the Issue following the below steps.
§  Use WITH REPLACE while using the RESTORE command
§  Execute the following SQL Query

Alter Database MicrosoftDynamicsAX_model
      SET SINGLE_USER With ROLLBACK IMMEDIATE  

RESTORE DATABASE MicrosoftDynamicsAX_model
      FROM DISK = 'D:\AX2012\MicrosoftDynamicsAX_model.bak'
      WITH REPLACE




Thank you and Happy DAXing... :)


Updated Query:

ALTER DATABASE AX_IntegrationDB
SET SINGLE_USER WITH
ROLLBACK IMMEDIATE
RESTORE DATABASE AX_IntegrationDB
FROM DISK = 'D:\SIngu\AdrenalinSharedDB.bak'
WITH MOVE 'AX_IntegrationDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.DARWIN\MSSQL\DATA\AX_IntegrationDB.mdf',
MOVE 'AX_IntegrationDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.DARWIN\MSSQL\DATA\AX_IntegrationDB_log.ldf',
REPLACE