• Quickly Restore a SQL Server Database

    If you frequently need to restore other peoples DB’s for testing here is a quick way to do so in Microsoft Sql Server.

    1. Open your Sql Server manager
    2. Create a new database (note the names and locations of the created files)
    3. Select the newly created DB and select Restore.
    4. Select from Device and choose the backup file to restore.
    5. Make sure you are overwriting the new database you created, usually quite apparent, look at the path.
    6. Check the log file and database name, modify where needed to the new database and log files (usually under logical name)
    7. Hopefully once set, you can restore the database, proceed hopefully, if not check the error and modify accordingly.
    8. Now you likely need to take ownership of the DB, run the following on the newly restored database to give it sa ownership:
      exec sp_changedbowner 'sa','true'



    Leave a reply