Restore a Database in SQL Server 2017

Here, I'll demonstrate how to restore a database using SQLOPS (now called Azure Data Studio).

You can restore a SQL Server database by using Transact-SQL, PowerShell, or via a GUI such as Azure Data Studio or SSMS. In this example, we're going to restore a backup of a brand new database called WideWorldImportersDW.

The WideWorldImporters database is a sample database provided by Microsoft's SQL Server Team to demonstrate how SQL Server's features can be used in a real-world scenario. In our example, we'll restore the WideWorldImportersDW database, which is a data warehouse version of the WideWorldImporters database.

This process will create a new database called WideWorldImportersDW. The database will contain various objects (such as tables, views, stored procedures, etc). The database will also contain sample data, so you can start creating queries as soon as it has been restored.

Download the Database Backup File

Before you start, go to this GitHub page and download the .bak file.

Restore a Database via the SQLOPS/Azure Data Studio GUI

  1. Open the Server Dashboard

    In the left pane of Azure Data Studio, right-click the server name and select Manage.

    Screenshot of SQLOPS with the Manage option highlighted
  2. Start the Restore Process

    Click the Restore button.

    Screenshot of SQLOPS with the Restore button highlighted
  3. Select a Restore from Option

    Select Backup file from the Restore from option.

    Screenshot of SQLOPS Database Backup dialog box
  4. Select the Backup File

    Navigate to the backup file, select it, then click OK.

    Screenshot of the backup file in the SQLOPS/Azure Data Studio file explorer
  5. Review the Settings

    This dialog box displays the details of the backup file that will be restored. If you have specific requirements, you can adjust certain settings using the FILES and OPTIONS at the top.

    For our example, leave it at the default settings and click Restore to restore the backup.

    Screenshot of Restore dialog box
  6. Restore Complete

    Once the restore is complete, a message is displayed confirming that the restore succeeded.

    Screenshot of SQLOPS/Azure Data Studio with the Restore Database succeeded message
  7. Navigate to the Database

    Click the Servers icon in the top-left so that you can navigate to the database.

    Screenshot of SQLOPS/Azure Data Studio with the Servers icon highlighted
  8. View the Database

    Expand the Databases node to reveal your newly restored database.

    Screenshot of SQLOPS/Azure Data Studio with the newly restored database highlighted.