Create Duplicate SQL Database for Testing

前端 未结 7 1398
栀梦
栀梦 2021-02-01 03:07

I have created a database on SQL server and a front end user application in winforms c#. It\'s up and running and working fine, but I\'ve now been asked to set up a test version

7条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 03:48

    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.

提交回复
热议问题