SQL Server – Create a Database from a Backup

Marketing
Marketing
  • Updated

By David Crowther

SQL_Server___Create_a_Database_from_a_Backup_-_1.PNG

Question:

I am trying to create a new SQL Database using a BACKUP file, which is the best way to do this?

Answer:

When creating a New Database from a BACKUP file, it is possible to create the New Database first and then once its created try to RESTORE it from the Backup file. However this method can lead to the error message shown below… where it says the ‘backup set holds a backup of a database other then the existing database.’

SQL_Server___Create_a_Database_from_a_Backup_-_2.PNG

Instead, we would recommend that you create the New Database using the BACKUP file at the same time.

To do this follow the steps below:

At Databases Level choose > Restore Database…

SQL_Server___Create_a_Database_from_a_Backup_-_3.PNG

Then in the GENERAL pane tick the Device radio button and choose the location of the Backup Set - .BAK file.

SQL_Server___Create_a_Database_from_a_Backup_-_4.PNG

If you now run the Database Restore using this method, SQL will create the New Database using the name of the backup set (.BAK file) and the Database is successfully created/restored.

SQL_Server___Create_a_Database_from_a_Backup_-_5.PNG

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.