Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

he backup set holds a backup of a database other than the existing - what should I do?

Asked by Alex Duncan Oct 4, 2022 1.2K views 1 answer
Share

About this question

I'm trying to restore my production .bak file to a new local instance using the belowscript but I still get this error:


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


I'm using SQL Server 2019.


USE [master]
RESTORE DATABASE [MyDatabase]
  FROM DISK = 'C:MyDatabase.bak'
  WITH 
  MOVE 'MyDatabase' TO 'C:MyDatabase.mdf',
  MOVE 'MyDatabase_log' TO 'C:MyDatabase_log.ldf',
  REPLACE
GO

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.