Download Adventureworkslt 2012
The sample database AdventureWorks plays an important role while performing test operations and learning about new features. So after the installation of SQL Server 2012 and searching for the sample database AdventureWorks I found that it contains only the 'mdf' file to download.
-->AdventureWorks download links and installation instructions.
Prerequisites
- SQL Server or Azure SQL Database. For the Full version of the sample, use SQL Server Evaluation/Developer/Enterprise Edition.
- SQL Server Management Studio. For the best results use the June 2016 release or later.
OLTP downloads
Direct links to the OLTP versions of AdventureWorks can be found below:
Data Warehouse downloads
Direct links to the Data Warehouse versions of AdventureWorks can be found below:
Creation scripts
The below scripts can be used to create the entire AdventureWorks database, irrespective of version.
GitHub links
Install to SQL Server
Restore backup
Follow the below steps to restore a backup of your database using SQL Server Management Studio.
- Open SQL Server Management Studio and connect to the target SQL Server instance.
- Right-click on the Databases node, and select Restore Database.
- Select Device and click the ellipses (..)
- In the dialog Select backup devices, click Add, navigate to the database backup in the filesystem of the server, and select the backup. Click OK.
- If needed, change the target location for the data and log files, in the Files pane. Note that it is best practice to place data and log files on different drives.
- Click OK. This will initiate the database restore. After it completes, you will have the AdventureWorks database installed on your SQL Server instance.
For more information on restoring a SQL Server database, see Restore a database backup using SSMS.
Attach a datafile
Follow the below steps to attach the datafile for your database using SQL Server Management Studio.
- Open SQL Server Management Studio and connect to the target SQL Server instance.
- Right-click on the Databases node, and select Attach.
- Select Add and navigate to the .MDF file you want to attach.
- Select the file and click OK.
- The database you selected should be displayed in the bottom window. If the file is listed as 'not found', select the ellipses (..) next to the file name and update the path to the correct path.
- If you only have the data file (.mdf), and not the log file (.ldf), then highlight the .ldf in the bottom window and select Remove. This will create a new log file.
- Select OK to attach the file. After the file is attached, you will have the AdventureWorks database installed on your SQL Server instance.
For more information on attaching database files, see Attach a database.
Install to Azure SQL Database
If you do not yet have a SQL Server in Azure, navigate to the Azure portal and create a new SQL Database. Amnesia the dark descent walkthrough guide. In the process of creating a database, you will create a server. Make note of the server. See this tutorial to create a database in minutes.
- 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.
- In the Select Source field, select Sample (AdventureWorksLT) to restore a backup of the latest AdventureWorksLT backup.
- Select Create to create your new SQL Database, which is the restored copy of the AdventureWorksLT database.
See also
Tutorials for SQL Server Management Studio
Tutorials for SQL Server database engine