{"id":1791,"date":"2024-08-17T18:00:00","date_gmt":"2024-08-17T16:00:00","guid":{"rendered":"https:\/\/b2analyze.nl\/?p=1791"},"modified":"2024-09-21T22:56:48","modified_gmt":"2024-09-21T20:56:48","slug":"adventureworks-database-install-guide","status":"publish","type":"post","link":"https:\/\/b2analyze.com\/nl\/adventureworks-database-install-guide\/","title":{"rendered":"AdventureWorks Database: Step-by-Step Installation Guide for Restoring to SQL Server"},"content":{"rendered":"<p>If you&#8217;re just starting out with SQL and looking for a hands-on way to practice SQL queries, the AdventureWorks database is an excellent option. It\u2019s a free sample database from Microsoft, representing a fictional company that manufactures cycling equipment and accessories. In this guide, I&#8217;ll walk you through the process of downloading and restoring this database to your SQL Server instance using SQL Server Management Studio (SSMS).<\/p>\n\n\n\n<p>Let&#8217;s dive in!<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#prerequisites\">Prerequisites<\/a><\/li><li><a href=\"#step-1-download-adventure-works-database\">Step 1. Download the AdventureWorks Database<\/a><\/li><li><a href=\"#step-2-restore-adventure-works-database-to-sql-server\">Step 2. Restore the AdventureWorks Database to SQL Server<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Before you begin, make sure that you have Microsoft SQL Server and SQL Server Management Studio (SSMS) installed on your machine. If you don\u2019t have these tools installed, check out <a href=\"https:\/\/b2analyze.com\/nl\/sql-server-ssms-free-edition\/\" target=\"_blank\" data-type=\"post\" data-id=\"1742\" rel=\"noreferrer noopener\">my previous post<\/a> for a quick setup guide to install a free edition.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-download-adventure-works-database\"><strong>Step 1. Download the AdventureWorks Database<\/strong><\/h2>\n\n\n\n<p>The first step is to download the AdventureWorks database from the official Microsoft website. Head over to the <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/samples\/adventureworks-install-configure?view=sql-server-ver16&amp;tabs=ssms\" target=\"_blank\" rel=\"noreferrer noopener\">AdventureWorks sample databases<\/a> page and scroll down to the &#8220;Download backup files&#8221; section. As you can see, there are multiple versions available. For the purpose of this guide, download the latest online transaction processing (OLTP) version which is &#8220;AdventureWorks2022.bak&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"890\" height=\"452\" src=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-download.png\" alt=\"AdventureWorks Database Download\" class=\"wp-image-2254\" srcset=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-download.png 890w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-download-300x152.png 300w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-download-768x390.png 768w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-download-18x9.png 18w\" sizes=\"(max-width: 890px) 100vw, 890px\" \/><\/figure>\n\n\n\n<p>Once downloaded, move the .bak file to your SQL Server\u2019s default backup folder. This path varies depending on your SQL Server version and installation configuration. For a default installation of SQL Server 2022 (16.x), the backup path will likely be:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"796\" height=\"132\" src=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-backup-location.png\" alt=\"AdventureWorks Backup Location\" class=\"wp-image-2255\" srcset=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-backup-location.png 796w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-backup-location-300x50.png 300w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-backup-location-768x127.png 768w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/adventureworks-backup-location-18x3.png 18w\" sizes=\"(max-width: 796px) 100vw, 796px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-restore-adventure-works-database-to-sql-server\"><strong>Step 2. Restore the AdventureWorks Database to SQL Server<\/strong><\/h2>\n\n\n\n<p>With the AdventureWorks backup file in place, you can now restore it using SQL Server Management Studio (SSMS). Launch the App from the Start Menu and connect to your SQL Server instance. If you&#8217;re unsure how to connect, check out <a href=\"https:\/\/b2analyze.com\/nl\/sql-server-ssms-free-edition\/\" target=\"_blank\" data-type=\"post\" data-id=\"1742\" rel=\"noreferrer noopener\">my previous post<\/a> for a walkthrough.<\/p>\n\n\n\n<p>Once connected, navigate to the Object Explorer on the left-hand side. Then right-click on &#8220;Databases&#8221; and select &#8220;Restore Database&#8221;. This will open the Restore Database wizard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-1024x543.png\" alt=\"SSMS Restore Database\" class=\"wp-image-2256\" srcset=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-1024x543.png 1024w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-300x159.png 300w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-768x408.png 768w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-1536x815.png 1536w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database-18x10.png 18w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-restore-database.png 1918w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the wizard, select &#8220;Device&#8221; and click on the three dots (&#8230;) next to it. Then click on &#8220;Add&#8221; and select the AdventureWorks2022.bak file that you downloaded earlier.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"563\" src=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-locate-backup-file.png\" alt=\"SSMS Locate Backup File\" class=\"wp-image-2266\" srcset=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-locate-backup-file.png 835w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-locate-backup-file-300x202.png 300w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-locate-backup-file-768x518.png 768w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-locate-backup-file-18x12.png 18w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/figure>\n\n\n\n<p>Confirm by clicking &#8220;OK&#8221; and click &#8220;OK&#8221; again to confirm the backup file location. This brings you back to the main Restore Database wizard. Click &#8220;OK&#8221; one more time to initiate the restore process. Once the restore is complete, the AdventureWorks database will appear under Databases in the Object Explorer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-1024x543.png\" alt=\"SSMS AdventureWorks Restored\" class=\"wp-image-2267\" srcset=\"https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-1024x543.png 1024w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-300x159.png 300w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-768x407.png 768w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-1536x814.png 1536w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored-18x10.png 18w, https:\/\/b2analyze.com\/wp-content\/uploads\/2024\/08\/ssms-adventureworks-restored.png 1918w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That\u2019s it! You\u2019ve successfully restored the AdventureWorks database to your SQL Server instance. This sample database is a great resource to enhance your SQL skills by querying and analysing the data. In future tutorials, I\u2019ll show you how to write SQL queries to explore the data in AdventureWorks. Stay tuned!<\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re just starting out with SQL and looking for a hands-on way to practice SQL queries, the AdventureWorks database is an excellent option. It\u2019s a free sample database from Microsoft, representing a fictional company that manufactures cycling equipment and accessories. In this guide, I&#8217;ll walk you through the process of downloading and restoring this [&hellip;]<\/p>","protected":false},"author":2,"featured_media":1684,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1791","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/posts\/1791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/comments?post=1791"}],"version-history":[{"count":31,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/posts\/1791\/revisions"}],"predecessor-version":[{"id":2849,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/posts\/1791\/revisions\/2849"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/media\/1684"}],"wp:attachment":[{"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/media?parent=1791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/categories?post=1791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b2analyze.com\/nl\/wp-json\/wp\/v2\/tags?post=1791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}