SQL-Server: The backup set holds a backup of a database other than the existing

前端 未结 24 1804
天命终不由人
天命终不由人 2020-12-07 06:49

I am trying to restore a SQL Server backup file for my database, but it is throwing an error as follow:

The backup set holds a backup of a database ot

24条回答
  •  温柔的废话
    2020-12-07 07:23

    I too came across this issue.

    Solution :

    • Don't create an empty database and restore the .bak file on to it.
    • Use 'Restore Database' option accessible by right clicking the "Databases" branch of the SQL Server Management Studio and provide the database name while providing the source to restore.
    • Also change the file names at "Files" if the other database still exists. Otherwise you get "The file '...' cannot be overwritten. It is being used by database 'yourFirstDb'".

提交回复
热议问题