Search code examples
sql-serverssms-16

Disable auto-population of Destination Database for Database Restore


Is there a way to disable the auto-population of the Destination Database when restoring from a Database Backup. I would like to restore a production data backup of Database A to a TEST server and to a different instance (Database B) without accidentally wiping out the Database A instance on the TEST server.


Solution

  • The best option to avoid a mishap like the one you mentioned would be to do the restores via T-SQL instead of the Restore wizard in SSMS. If you're not familiar with the RESTORE command syntax you can view the documentation on this here. You can also try generating a script from the GUI with all the options that you typically use, and executing this script with the file names substituted if they change. To do this configure the Restore wizard with all of the options you normally use and look for Script button on the top of the General page. On this button, press the arrow drop-down and you'll be able to generate a script directly to a file, query editor, or your clipboard.