Published on

January 1, 2020

Installing AdventureWorks2016 and AdventureWorksDW2016 Sample Databases on SQL Server

Are you looking to learn how to design a database using SQL Server? Microsoft has provided sample databases called AdventureWorks2016 and AdventureWorksDW2016 to help you understand the process. In this article, we will guide you through the installation process of these sample databases on a stand-alone instance of SQL Server.

Installing AdventureWorks2016

There are two methods to install the AdventureWorks2016 database:

Method 1: Direct Download and Restore

1. Download the AdventureWorks2016.bak backup file from the Microsoft website.

2. Open SQL Server Management Studio and connect to your stand-alone SQL instance.

3. Expand the database engine in the Object Explorer, right-click on Databases, and select Restore Database.

4. In the Restore Database window, select Device as the source and click on the ellipse (…).

5. In the Locate backup devices window, navigate to the directory where the AdventureWorks2016.bak file is downloaded and select it.

6. Optionally, you can change the physical location of the data and log files in the Files pane.

7. Click OK to initiate the database restoring process.

8. Once the database is restored successfully, you can connect to it using SQL Server Management Studio.

Method 2: Build a Database by Executing Installation Scripts

1. Download the installation scripts for AdventureWorks2016 from the Microsoft website.

2. Extract the files and open the “instawdb.sql” file in SQL Server Management Studio.

3. Enable SQLCMD mode in SSMS by clicking on the Query menu and selecting SQLCMD Mode.

4. Execute the script by clicking on Execute or pressing F5.

5. The script will create all the database objects and add them to the tables.

6. Once the script is executed successfully, you will see the AdventureWorks2016 database in the Object Explorer of SQL Server Management Studio.

Installing AdventureWorksDW2016

To install the AdventureWorksDW2016 database, you can follow the same methods as mentioned above for AdventureWorks2016.

Installing Sample Databases on Azure SQL Server

If you want to install the sample databases on Azure SQL Server, you need to create a SQL Server resource group with the AdventureWorksLT database. Here’s how:

1. Log in to the Microsoft Azure portal and click on “Create a resource” on the home screen.

2. Select “SQL Database” on the next screen.

3. Fill in the details of the subscription, resource group, database name, server name, and compute + storage type.

4. In the Additional settings menu, choose “Sample” from the “Use existing data” option under the Data source section.

5. Review the configuration and click on Create to start the SQL Database deployment process.

6. Once the deployment process completes, you can connect to the database from SQL Server Management Studio.

Summary

In this article, we have explained how to install the AdventureWorks2016 and AdventureWorksDW2016 sample databases on a stand-alone instance of SQL Server. You can choose to install them by restoring the backup files or by executing the installation scripts. Additionally, we have also provided instructions on how to install the AdventureWorksLT database on Azure SQL Server. These sample databases are great resources for learning and practicing database design using SQL Server.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.