| title | AdventureWorks Sample Databases | |
|---|---|---|
| description | Follow these instructions to download and install AdventureWorks sample databases to SQL Server. | |
| author | MashaMSFT | |
| ms.author | mathoma | |
| ms.reviewer | randolphwest | |
| ms.date | 03/16/2026 | |
| ms.service | sql | |
| ms.subservice | samples | |
| ms.topic | concept-article | |
| ms.custom |
|
|
| monikerRange | >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric-sqldb |
[!INCLUDE SQL Server Azure SQL Database Azure SQL MI FabricSQLDB]
This article provides direct links for downloading AdventureWorks sample databases and instructions for restoring them to your database.
For more information about samples, see the Samples GitHub repository.
- SQL Server or Azure SQL Database
- SQL Server Management Studio (SSMS) or MSSQL extension for Visual Studio Code
Use these links to download the appropriate sample database for your scenario.
- OLTP data works for most typical online transaction processing workloads.
- Data Warehouse (DW) data works 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.
You can find more files on GitHub:
Use the .bak file to restore your sample database to your [!INCLUDE ssnoversion-md] instance. You can restore the database by using the RESTORE Statements T-SQL command, or by using the graphical interface (GUI) in SSMS, the MSSQL extension for Visual Studio Code, or any T-SQL query tool.
If you're not familiar with using SSMS, review Connect and query using SSMS to get started.
To restore your database in SSMS, follow these steps:
-
Download the appropriate
.bakfile from one of the links provided in the Download backup files section of this article. -
Move the
.bakfile to your [!INCLUDE ssnoversion-md] backup location. This location varies depending on your installation location, instance name, and version of [!INCLUDE ssnoversion-md]. For example, the default location for a default instance of [!INCLUDE sssql22-md] is:C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup -
Open SSMS and connect to your [!INCLUDE ssnoversion-md] instance.
-
Right-click Databases in Object Explorer and then select Restore Database... to start the Restore Database wizard.
:::image type="content" source="media/adventureworks-install-configure/restore-db-ssms.png" alt-text="Screenshot showing the steps for starting the Restore Database wizard.":::
-
Select Device, and then select the ellipsis (...) to choose a device.
-
Select Add, and then choose the
.bakfile you recently moved to the backup location. If you moved your file to this location but you don't see it in the wizard, [!INCLUDE ssnoversion-md] or the user signed into [!INCLUDE ssnoversion-md] doesn't 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 that 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.
:::image type="content" source="media/adventureworks-install-configure/restore-db-wizard-ssms.png" alt-text="Screenshot showing the Restore Database window. The backup set to restore and the OK option are highlighted." lightbox="media/adventureworks-install-configure/restore-db-wizard-ssms.png":::
For more information on restoring a [!INCLUDE ssnoversion-md] database, see Restore a Database Backup Using SSMS.
You can restore your sample database by using T-SQL. The following example restores [!INCLUDE sssampledbobject-md], but the database name and installation file path can vary depending on your environment.
To restore [!INCLUDE sssampledbobject-md] on Windows, modify values as appropriate to your environment and then run the following T-SQL command:
USE [master];
GO
RESTORE DATABASE [AdventureWorks2025]
FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\AdventureWorks2025.bak'
WITH
FILE = 1,
NOUNLOAD,
STATS = 5;
GOTo restore [!INCLUDE sssampledbobject-md] on Linux, change the Windows filesystem path to Linux, and then run the following T-SQL command:
USE [master];
GO
RESTORE DATABASE [AdventureWorks2025]
FROM DISK = '/var/opt/mssql/backup/AdventureWorks2025.bak'
WITH
MOVE 'AdventureWorks2025' TO '/var/opt/mssql/data/AdventureWorks2025_Data.mdf',
MOVE 'AdventureWorks2025_log' TO '/var/opt/mssql/data/AdventureWorks2025_log.ldf',
FILE = 1,
NOUNLOAD,
STATS = 5;
GOYou have two options for viewing sample SQL Database data. You can use a sample when you create a new database, or you can deploy a database from [!INCLUDE ssnoversion-md] directly to Azure by using SSMS.
To get sample data for SQL Managed Instance instead, see Quickstart: Restore a database to Azure SQL Managed Instance with SSMS.
When you create a new database in SQL Database, you can create a blank database, restore from a backup, or select sample data to populate your new database.
Follow these steps to deploy a new sample AdventureWorksLT database in Azure SQL Database:
-
In the resource menu, expand Azure SQL Database and select SQL databases.
-
Select the + Create dropdown button and select SQL database.
:::image type="content" source="media/adventureworks-install-configure/create-sql-database.png" alt-text="Screenshot from the Azure portal showing the SQL databases page, the Create button, and the SQL database option." lightbox="media/adventureworks-install-configure/create-sql-database.png":::
-
In the Create SQL Database page, fill in the necessary information to create your database.
-
On the Additional settings tab, choose Sample as the existing data under Data source:
:::image type="content" source="media/adventureworks-install-configure/deploy-sample-to-azure.png" alt-text="Screenshot that shows the Sample option under Use existing data." lightbox="media/adventureworks-install-configure/deploy-sample-to-azure.png":::
-
Select Next: Tags.
-
Consider using Azure tags. For example, use the
OwnerorCreatedBytag to identify who created the resource, and use theEnvironmenttag to identify whether this resource is in Production, Development, or another environment. For more information, see Develop your naming and tagging strategy for Azure resources. -
Select Create to create your new SQL Database, which is the restored copy of the
AdventureWorksLTdatabase.
SSMS allows you to deploy a database directly to Azure SQL Database. This method is intended for development and testing, so it doesn't currently provide data validation. Don't use this deployment method for production.
To deploy a sample database from [!INCLUDE ssnoversion-md] to SQL Database, follow these steps:
-
Connect to your [!INCLUDE ssnoversion-md] in SSMS.
-
If you didn't already, restore the sample database to SQL Server.
-
Right-click your restored database in Object Explorer, and then select Tasks > Deploy Database to Microsoft Azure SQL Database.
:::image type="content" source="media/adventureworks-install-configure/deploy-db-to-azure.png" alt-text="Screenshot that shows the menu steps for deploying a database to SQL Database.":::
-
Complete the steps in the wizard to connect to SQL Database and deploy your database.
To load a sample AdventureWorksLT database in a new SQL database in Microsoft Fabric, create a new SQL database in Fabric. Then, under Build your database, select the Sample data button.
Instead of restoring a database, you can use scripts to create the AdventureWorks databases, regardless of version.
Use the following scripts to create the entire AdventureWorks database:
You can find additional information about using the scripts on GitHub.