Create Duplicate SQL Database for Testing

I found this method to be most effective on SQL Server 2005 and 2008, Express Editions:

From the Microsoft Docs:

  1. Right click on the database you want to duplicate and choose Tasks->"Back Up..."
  2. Save the back up to a .bak file
  3. Right click on the "Databases" folder in the Object Explorer in SQL Server Management Studio
  4. Choose "Restore Database"
  5. As the source, select "File" and point to the .bak file you created earlier.
  6. Change the name of the database to restore to (this was the key step for me - you are not constrained to the options in the dropdown.)

SSMS will restore your .bak file to a new database, according to the name that you give it. enter image description here


use copy database option in SQL server management studio

enter image description here

Tags:

Sql Server