Skip to content

Commit b47eadc

Browse files
committed
AdventureWorks 2025 updates
AdventureWorks OLTP with UTF-8 conversion and date fixes AdventureWorks DW with UTF-8 conversion
1 parent eddb7b3 commit b47eadc

File tree

104 files changed

+635884
-635876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+635884
-635876
lines changed

samples/databases/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contains sample databases for Microsoft's SQL databases include SQL Server, Azur
44

55
__[wide-world-importers](wide-world-importers/)__
66

7-
The new sample database for SQL Server 2016 and Azure SQL Database. It illustrates the core capabilities of SQL Server 2016 and Azure SQL Database, for transaction processing (OLTP), data warehousing and analytics (OLAP) workloads, as well as hybrid transaction and analytics processing (HTAP) workloads.
7+
The sample database for features introduced in SQL Server 2016 and Azure SQL Database. It illustrates the core capabilities of SQL Server 2016 and Azure SQL Database, for transaction processing (OLTP), data warehousing and analytics (OLAP) workloads, as well as hybrid transaction and analytics processing (HTAP) workloads.
88

99
__[contoso-data-warehouse](contoso-data-warehouse/)__
1010

Lines changed: 81 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,114 @@
11
# AdventureWorks Readme
22

3-
The AdventureWorks databases are sample databases that were originally published by Microsoft to show how to design a SQL Server database using SQL Server 2008. AdventureWorks is the OLTP sample, and AdventureWorksDW is the data warehouse sample.
3+
The `AdventureWorks` databases are sample databases that were originally published by Microsoft to show how to design a SQL Server database using SQL Server 2008. `AdventureWorks` is the OLTP sample, and `AdventureWorksDW` is the data warehouse sample.
44

5-
Database design has progressed since AdventureWorks was first published. For a sample database leveraging more recent features of SQL Server, see [WideWorldImporters](../wide-world-importers/).
5+
## Release history
66

7-
Note that AdventureWorks has not seen any significant changes since the 2012 version. The only differences between the various versions of AdventureWorks are the name of the database and the database compatibility level. To install the AdventureWorks databases with the database compatibility level of your SQL Server instance, you can install from a version-specific backup file or from an install script.
7+
Database design has progressed since `AdventureWorks` was first published. For a sample database leveraging more recent features of SQL Server, see [WideWorldImporters](../wide-world-importers/).
8+
9+
### Changes between SQL Server 2012 and SQL Server 2022
10+
11+
`AdventureWorks` has not seen any significant changes since the 2012 version. The only differences between the various versions of `AdventureWorks` are the name of the database and the database compatibility level. To install the `AdventureWorks` databases with the database compatibility level of your SQL Server instance, you can install from a version-specific backup file or from an install script.
12+
13+
### Changes in SQL Server 2025
14+
15+
To coincide with the release of SQL Server 2025, the `AdventureWorks` database has been modified to take advantage of recent Database Engine features:
16+
17+
- Query Store is enabled
18+
- Accelerated database recovery (ADR) is enabled
19+
- Optimized locking is enabled
20+
- Dates have been adjusted
821

922
## Prerequisites
10-
Filestream must be installed in your SQL Server instance.
23+
24+
FILESTREAM must be installed in your SQL Server instance.
1125

1226
## Install from a script
1327

14-
The install scripts create the sample database to have the database compatibility of your current version of SQL Server. Each script generates the version-specific information based on your current instance of SQL Server. This means you can use either the AdventureWorks or AdventureWorksDW install script on any version of SQL Server including CTPs, SPs, and interim releases.
28+
The install scripts create the sample database to have the database compatibility of your current version of SQL Server. Each script generates the version-specific information based on your current instance of SQL Server. This means you can use either the `AdventureWorks` or `AdventureWorksDW` install script on any version of SQL Server including preview versions, service packs, cumulative updates, and interim releases.
1529

1630
### Install notes
17-
When installing from a script, the default database name is AdventureWorks or AdventureWorksDW. If you want the version added to the name, edit the database name at the beginning of the script.
1831

19-
The oltp script drops an existing AdventureWorks database, and the data warehouse script drops an existing AdventureWorksDW. If you don't want that to happen, you can update the $(DatabaseName) in the script to a different name, for example AdventureWorks-new.
32+
When installing from a script, the default database name is `AdventureWorks` or `AdventureWorksDW`. If you want the version added to the name, edit the database name at the beginning of the script.
33+
34+
The OLTP script drops an existing `AdventureWorks` database, and the data warehouse script drops an existing `AdventureWorksDW`. If you don't want that to happen, you can update the `$(DatabaseName)` parameter in the script to a different name, for example `AdventureWorks-new`.
35+
36+
### Install AdventureWorks
37+
38+
1. Copy the GitHub data files and scripts for [AdventureWorks](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works/oltp-install-script) to the `C:\Samples\AdventureWorks` folder on your local client.
39+
40+
1. Or, [download AdventureWorks-oltp-install-script.zip](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks-oltp-install-script.zip) and extract the zip file to the `C:\Samples\AdventureWorks` folder.
41+
42+
1. Open `C:\Samples\AdventureWorks\instawdb.sql` in SQL Server Management Studio (SSMS) and follow the instructions at the top of the file.
2043

21-
### To install AdventureWorks
44+
### Install AdventureWorksDW
2245

23-
1. Copy the GitHub data files and scripts for [AdventureWorks](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works/oltp-install-script) to the C:\Samples\AdventureWorks folder on your local client.
24-
2. Or, [download AdventureWorks-oltp-install-script.zip](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks-oltp-install-script.zip) and extract the zip file to the C:\Samples\AdventureWorks folder.
25-
3. Open C:\Samples\AdventureWorks\instawdb.sql in SQL Server Management Studio and follow the instructions at the top of the file.
46+
1. Copy the GitHub data files and scripts for [AdventureWorksDW](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works/data-warehouse-install-script) to the `C:\Samples\AdventureWorksDW` folder on your local client.
2647

27-
### To install AdventureWorksDW
48+
1. Or, [download AdventureWorksDW-data-warehouse-install-script.zip](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW-data-warehouse-install-script.zip) and extract the zip file to the `C:\Samples\AdventureWorksDW` folder.
2849

29-
1. Copy the GitHub data files and scripts for [AdventureWorksDW](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works/data-warehouse-install-script) to the C:\Samples\AdventureWorksDW folder on your local client.
30-
2. Or, [download AdventureWorksDW-data-warehouse-install-script.zip](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW-data-warehouse-install-script.zip) and extract the zip file to the C:\Samples\AdventureWorksDW folder.
31-
3. Open C:\Samples\AdventureWorksDW\instawdbdw.sql in SQL Server Management Studio and follow the instructions at the top of the file.
50+
1. Open `C:\Samples\AdventureWorksDW\instawdbdw.sql` in SSMS and follow the instructions at the top of the file.
3251

3352
## Install from a backup
3453

3554
Download backup files from [AdventureWorks samples databases](https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks) on GitHub.
3655

37-
You can install AdventureWorks or AdventureWorksDW by restoring a backup file. The backup files are version-specific. You can restore each backup to its respective version of SQL Server, or a later version.
56+
You can install `AdventureWorks` or `AdventureWorksDW` by restoring a backup file. The backup files are version-specific. You can restore each backup to its respective version of SQL Server, or a later version.
3857

39-
For example, you can restore AdventureWorks2016 to SQL Server (starting with 2016). Regardless of whether AdventureWorks2016 is restored to SQL Server 2016, 2017, or a later version, the restored database has the database compatibility level of SQL Server 2016.
58+
For example, you can restore `AdventureWorks2016` to SQL Server (starting with 2016). Regardless of whether `AdventureWorks2016` is restored to SQL Server 2016 or a later version, the restored database has the database compatibility level of SQL Server 2016 (130).
4059

4160
### To restore a database backup
4261

43-
1. Locate the Backup folder for your SQL Server instance. The default path for 64-bit SQL Server 2016 is C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup. The MSSQL value is MSSQL14 for SQL Server 2017, MSSQL13 for SQL Server 2016, MSSQL12 for SQL Server 2014, MSSQL11 for SQL Server 2012, and MSSQL10 for SQL Server 2008R2.
44-
2. Download the .bak file from [AdventureWorks release](https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks) and save it to the Backup folder for your SQL Server instance.
45-
3. Open SQL Server Management Studio and connect to your SQL Server instance.
46-
4. Restore the database using the SQL Server Management Studio user interface. For more information, see [Restore a database backup using SSMS](https://docs.microsoft.com/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms).
47-
5. Or, run the RESTORE DATABASE command in a new query Window.
48-
On the Standard toolbar, click the New Query button.
49-
5. Execute the following code in the query window. Note, the file paths in the scripts are the default paths. You may need to update the paths in the scripts to match your environment.
62+
1. Locate the Backup folder for your SQL Server instance. The default path for 64-bit SQL Server 2025 is `C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup`. You can replace `MSSQL17` with a different value depending on the SQL Server version installed.
5063

51-
### Example T-SQL RESTORE DATABASE command
64+
| SQL Server version | MSSQL value | Compatibility level |
65+
| --- | --- | --- |
66+
| SQL Server 2025 (17.x) | MSSQL17 | 170 |
67+
| SQL Server 2022 (16.x) | MSSQL16 | 160 |
68+
| SQL Server 2019 (15.x) | MSSQL15 | 150 |
69+
| SQL Server 2017 (14.x) | MSSQL14 | 140 |
70+
| SQL Server 2016 (13.x) | MSSQL13 | 130 |
5271

53-
This example restores AdventureWorksDW2016 to SQL Server 2016. Note, the file paths are the default paths. If you use this example, you might need to update the paths in the scripts to match your environment.
72+
1. Download the `.bak` file from [AdventureWorks release](https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks) and save it to the Backup folder for your SQL Server instance.
5473

55-
```sql
74+
1. Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.
75+
76+
1. Restore the database using the SSMS user interface. For more information, see [Restore a database backup using SSMS](https://learn.microsoft.com/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms).
77+
78+
1. Or, run the `RESTORE DATABASE` command in a new query window. On the Standard toolbar, click the New Query button.
79+
80+
1. Execute the following code in the query window. The file paths in the scripts are the default paths. You may need to update the paths in the scripts to match your environment.
81+
82+
## Examples
5683

57-
USE [master]
84+
### Restore AdventureWorks2025 database
5885

59-
RESTORE DATABASE AdventureWorksDW2016
60-
FROM disk= 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\AdventureWorksDW2016.bak'
61-
WITH MOVE 'AdventureWorksDW2016_data'
62-
TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2016.mdf',
63-
MOVE 'AdventureWorksDW2016_Log'
64-
TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2016.ldf'
65-
,REPLACE
86+
This example restores `AdventureWorks2025` to SQL Server 2025. The file paths are the default paths. If you use this example, you might need to update the paths in the scripts to match your environment.
6687

88+
```sql
89+
USE [master];
90+
GO
91+
92+
RESTORE DATABASE AdventureWorks2025
93+
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\AdventureWorks2025.bak'
94+
WITH
95+
MOVE 'AdventureWorks2025_data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\AdventureWorks2025.mdf',
96+
MOVE 'AdventureWorks2025_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\AdventureWorks2025.ldf',
97+
REPLACE;
6798
```
6899

100+
### Restore AdventureWorksDW2022 database
101+
102+
This example restores `AdventureWorksDW2022` to SQL Server 2022. The file paths are the default paths. If you use this example, you might need to update the paths in the scripts to match your environment.
103+
104+
```sql
105+
USE [master];
106+
GO
107+
108+
RESTORE DATABASE AdventureWorksDW2022
109+
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup\AdventureWorksDW2022.bak'
110+
WITH
111+
MOVE 'AdventureWorksDW2022_data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2022.mdf',
112+
MOVE 'AdventureWorksDW2022_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2022.ldf',
113+
REPLACE;
114+
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)