AdventureWorks sample databases
Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Parallel Data Warehouse
This article provides direct links to download AdventureWorks sample databases, as well as instructions for restoring them to SQL Server and Azure SQL Database.
For more information about samples, see the Samples GitHub repository.
Download backup files
Use these links to download the appropriate sample database for your scenario.
- OLTP data is for most typical online transaction processing workloads.
- Data Warehouse (DW) data is for data warehousing workloads.
- Lightweight (LT) data is a lightweight and pared down version of the OLTP sample.
If you're not sure what you need, start with the OLTP version that matches your SQL Server version.
Additional files can be found directly on GitHub:
Restore to SQL Server
You can use the
.bak file to restore your sample database to your SQL Server instance. You can do so using the RESTORE (Transact-SQL) command, or using the graphical interface (GUI) in SQL Server Management Studio or Azure Data Studio.
If you're not familiar using SQL Server Management Studio (SSMS), you can see connect & query to get started.
To restore your database in SQL Server Management Studio, follow these steps:
Download the appropriate
.bakfile from one of links provided in the download backup files section.
.bakfile to your SQL Server backup location. This varies depending on your installation location, instance name and version of SQL Server. For example, the default location for a default instance of SQL Server 2019 is:
C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup.
Open SQL Server Management Studio (SSMS) and connect to your SQL Server in.
Right-click Databases in Object Explorer > Restore Database... to launch the Restore Database wizard.
Select Device and then select the ellipses (...) to choose a device.
Select Add and then choose the
.bakfile you recently moved to this location. If you moved your file to this location but you're not able to see it in the wizard, this typically indicates a permissions issue - SQL Server or the user signed into SQL Server does not have permission to this file in this folder.
Select OK to confirm your database backup selection and close the Select backup devices window.
Check the Files tab to confirm the Restore as location and file names match your intended location and file names in the Restore Database wizard.
Select OK to restore your database.
For more information on restoring a SQL Server database, see Restore a database backup using SSMS.
Deploy to Azure SQL Database
You have two options to view sample Azure SQL Database data. You can use a sample when you create a new database, or you can deploy a database from SQL Server directly to Azure using SQL Server Management Studio (SSMS).
To get sample data for Azure SQL Managed Instance instead, see restore World Wide Importers to SQL Managed Instance.
Deploy new sample database
When you create a new database in Azure SQL Database, you have the option to create a blank database, or a sample database.
Follow these steps to use a sample database to create a new database:
Connect to your Azure portal.
Select Create a resource in the top left of the navigation pane.
Select Databases and then select SQL Database.
Fill in the requested information to create your database.
On the Additional settings tab, choose Sample as the existing data under Data source:
Select Create to create your new SQL Database, which is the restored copy of the AdventureWorksLT database.
Deploy database from SQL Server
SQL Server Management Studio provides the ability to deploy a database directly to Azure SQL Database. This method does not currently provide data validation so is intended for development and testing and should not be used for production.
To deploy a sample database from SQL Server to Azure SQL Database, follow these steps:
Connect to your SQL Server in SQL Server Management Studio.
If you haven't already done so, restore the sample database to SQL Server.
Right-click your restored database in Object Explorer > Tasks > Deploy Database to Microsoft Azure SQL Database....
Follow the wizard to connect to Azure SQL Database and deploy your database.
Instead of restoring a database, alternatively, you can use scripts to create the AdventureWorks databases regardless of version.
The below scripts can be used to create the entire AdventureWorks database:
Additional information about using the scripts can be found on GitHub.
Once you've restored your sample database, using the following tutorials to get started with SQL Server: