Professional Documents
Culture Documents
Databases
Install the Adventure Works 2014 OLTP database from a script
The Adventure Works database can be created by running the instawdb.sql DDL script contained in the
Adventure Works 2014 OLTP Script.zip file. The instawdb.sql script depends on two path environment
variables: SqlSamplesDatabasePath and SqlSamplesSourceDataPath. The SqlSamplesDatabasePath
environment variable is set to the default Microsoft SQL Server 2014 path. The
SqlSamplesSourceDataPath environment variable is set to the default script CSV data path. An invalid
SqlSamplesSourceDataPath path generates an error that the bulk load steps failed because the .csv files
could not be found. The DDL script must be run in SQLCMD mode inside SQL Server Management Studio.
To install the Adventure Works 2014 OLTP database from a script:
1.
2.
3.
4.
5.
6.
4.
5.
6.
3.
4.
5.
6.
b. Change the :setvar SqlSamplesSourceDataPath variable to the path containing the .csv
files.
On the Query menu, click SQLCMD Mode.
On the Standard toolbar, click the Execute button to run the script.
4.
5.