This lab will demonstrate how to setup your local database development environment with the sample development database.

DevOps MPP Course Source

Pre-requisites:

  • Visual Studio 2017
  • Local SQL Server 2016 installation (optional)
  • SQL Server Management Studio
  • SQL Server 2016 SP1 installed locally

Lab Tasks:

  • Download WideWorldImporters sample database
  • Restore multiple copies of the database

Estimated Lab Time:

  • approx. 30 minutes

Task 1: Download WideWorldImporters sample database

In this step, you will get the sample database from the official Microsoft repository.

  1. The Microsoft Database Sample Database repository is located at https://github.com/Microsoft/sql-server-samples/. This is the location for all sample databases.

  2. We will be using the WideWorldImporters sample database, so naviate to https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0 to find the various versions of WideWorldImporters that are available for download.

  3. Download the Azure SQL Database Standard tier .bacpac file for the OLTP version. Since we will deploy to Azure SQL database and use LocalDB, we want this file: WideWorldImporters-Standard.bacpac.

    This should be located on the page below the SQL Server 2016 SP1 versions and Azure SQL Database Premium tier samples.

    Wide World Importers sample database downloads

  4. Save this file in a location on your local machine.

Task 2: Restore multiple copies of the database

In this step, you will restore the various development copies that are needed for future labs.

  1. Start SQL Server Management Studio

  2. Connect to your LocalDB instance. The address, by default for Visual Studio 2017, is: (localdb)\ProjectsV13. The connection dialog is shown below:

    Management Studio Connection Dialog

  3. In Object Explorer, right-click the Databases folder and click Import Data-tier Application, as shown below.

    Import DAC choice

  4. Skip the first dialog of the wizard by clicking Next

    Import DAC Wizard welcome

  5. On the Import Settings page of the wizard, ensure the Import from local disk radio button is selected. Click the Browse button and navigate to the location of the WideWorldImporters-Standard.bacpac file that you downloaded in the first part of this lab.

    Import DAC Wizard choose import file

    Click Next to continue.

  6. On the Database Settings page, change the New database name text box to WideWorldImporters-SSDT. The data file path and log file path default to the AppData folder under your local user. Leave these at the defaults.

    Import DAC Wizard set database name and file locations

  7. Review the Summary page, then click Finish.

    Import DAC Wizard Summary

  8. On the Results page, when processing finishes, all items should show success. Click Close once you have reviewed this page.

    Import DAC Wizard Progress

  9. Verify that the database has been created by expanding the Databases folder in Object Explorer. There should be a database named WideWorldImporters-SSDT

    Management Studio databases folder

  10. Repeat steps 3-9 to create another new database named WideWorldImporters-RR

Summary

In this lab you have downloaded the WideWorldImporters sample database from the official Microsoft repository and restored the various development copies that are needed for future labs.