Problem
I want to try some of the new features in SQL Server 2025. I’ve installed the CTP 2.0 preview on a virtual machine, and now I need some sample databases to play around with. Can I use the AdventureWorks database like in previous versions of SQL Server?
Solution
The AdventureWorks sample databases for SQL Server have been around for quite a long time. There are three sample databases: one designed for an OLTP workload, one for a data warehouse workload, and one small, lightweight database with only a couple of tables. There are other tips on how to install them for previous versions of SQL Server, as well as how to install a sample database on Azure SQL DB:
- AdventureWorks Database Installation Steps
- Attach Sample Database – Adventureworks in SQL Server 2012
- Install AdventureWorks Database in Azure SQL Database
It’s possible to install the AdventureWorks sample database in SQL Server 2025 as well, and this tip will guide you through the process. Keep in mind: SQL Server 2025 was in preview at the time of writing (CTP 2.0 was used to write this tip), so:
- Functionality or user interfaces can still change, disappear, or be added until the final release.
- I recommended to install it on a virtual machine to easily delete later.
The tip, How to Configure a SQL Server 2025 Demo Environment in Azure, explains step-by-step how you can do this.
Installing the AdventureWorks Databases in SQL Server 2025
The AdventureWorks sample databases are available as database backups. You can download from the official documentation website. There are multiple versions available for each of the three sample databases, beginning from SQL Server 2008R2 until SQL Server 2022.

At the time of writing, there is not yet a specific version available for SQL Server 2025. This is not really a problem, as the databases themselves don’t change much between versions.
Download the backup files and put them on a machine running SQL Server 2025. Open SQL Server Management Studio (SSMS) and connect to your SQL Server 2025 instance. Right-click the databases node and choose Restore Database…

On the General page of the Restore Database menu, switch the source to Device and click the ellipsis.

In the pop-up menu, select Add to add a new backup device (.bak file you just downloaded).

Navigate to the folder where you’ve put the downloaded backup files and select the backup you want to restore.

Click OK to close the pop-up window.

Back on the General page, you can now view the backup information and optionally change the database name.

By choice, you can go to the Files page and choose to relocate the files to a specific folder, or you can change the name of the data and/or log files.

Click OK in the bottom right corner to start the backup restore. The restore process shouldn’t take long. After it’s completed, the sample database should now be visible in the Object Explorer:

You can repeat the same process to restore the other sample databases.
Alternative: Running T-SQL Scripts
Aside from restoring a backup, you can also create a sample database from scratch using T-SQL scripts, which can be downloaded from the same website as the backup files. This is a .zip file that contains multiple CSV files with the sample data, as well as one long T-SQL script that needs to be run in SQLCMD mode, which can be enabled from the Query menu in SSMS.

Ensure all files are in the expected folder on the machine that runs the SQL Server 2025 instance (or change the value of variable SqlSamplesSourceDataPath) and run the script. On my virtual machine, it took about half a minute to create the OLTP database and all its objects, and load the data from the different CSV files.

You can use the same method to create the AdventureWorksDW database from a T-SQL script.
Setting the Compatibility Level
There’s one advantage to running the T-SQL scripts instead of restoring a backup: the sample database is created using the compatibility level of the database instance, which is 170 for SQL Server 2025 (also the compatibility level of an Azure SQL DB at the time of writing). If you restore a backup, it keeps the compatibility level of the database from which the backup was taken, which is 160 for SQL Server 2022. This means that some new functionality might not work because the database is at an older compatibility level:

To make this script execute successfully, we need to change the compatibility level in the database options. However, with the pre-installed SSMS on the virtual machine, the 170 level isn’t listed:

What about the database we created through the T-SQL scripts? The dropdown menu lists the compatibility level as blank:

It’s as if the 170 level doesn’t exist. This is because we’re not using the most recent version of SSMS. When we open the same options menu with SSMS 21 (which is the latest version at the time of writing), the 170 level does appear in the dropdown list:

The T-SQL script executes normally after level changed to 170:

If for some reason you cannot use the most recent version of SSMS, you can always set the compatibility level using T-SQL.
--MSSQLTips.com
ALTER DATABASE AdventureWorks2022 SET COMPATIBILITY_LEVEL = 170;
Next Steps
- Be sure to check out the tip, How to Configure a SQL Server 2025 Demo Environment in Azure, on how to configure a virtual machine in Azure with the SQL Server 2025 preview pre-installed.
- Curious about that REGEXP_LIKE function? Stay tuned for tips about new T-SQL functionality in SQL Server 2025!
- You can find all SQL Server 2025 related tips in this overview.