{"id":33,"date":"2015-09-13T21:01:18","date_gmt":"2015-09-13T20:01:18","guid":{"rendered":"https:\/\/sqldoubleg.live-website.com\/?p=33"},"modified":"2015-11-02T10:16:13","modified_gmt":"2015-11-02T10:16:13","slug":"day-0-adventureworks-setting-up-adventureworks-sample-database","status":"publish","type":"post","link":"https:\/\/www.sqldoubleg.com\/es\/2015\/09\/13\/day-0-adventureworks-setting-up-adventureworks-sample-database\/","title":{"rendered":"Day 0 @ AdventureWorks, setting up AdventureWorks sample database"},"content":{"rendered":"<p>Guide to explain how get AdventureWorks sample database and install it in your environment&nbsp;I wasn&#8217;t planning writing this post, because there are tons of resources available on the internet, but since I want to create a comprehensive series of exercises, starting from the very basic, I understand most\u00a0people interested on doing them, might have limited SQL Server knowledge.<\/p>\n<p>AdventureWorks is one of the Microsoft sample databases ready for downloading <a href=\"https:\/\/msftdbprodsamples.codeplex.com\/releases\/view\/125550\">here<\/a>\u00a0which can be installed on any SQL Server whose version is equal or superior to the version of the database, I mean if you download AdventureWorks2014 (current version) that can be installed in SQL Server 2014 onwards, not possible then in SQL 2012, 2008R2 and so on.<\/p>\n<p>A free version of SQL Server is available for downloading <a href=\"https:\/\/www.microsoft.com\/en-gb\/download\/details.aspx?id=42299\">here<\/a>. It&#8217;s called Express Edition and as I said is free to anyone. Although I recommend, if you can, get a Developer Edition which contains all the features SQL Server has.<\/p>\n<p>Once SQL Server is installed, (if you are not sure, just leave all defaults and click &#8216;Next&#8217; till is done) you have to restore the AdventureWorks2014 database.<\/p>\n<p>I recommend downloading the &#8216;<a id=\"fileDownload0\" class=\"FileNameLink\" tabindex=\"9\" href=\"https:\/\/msftdbprodsamples.codeplex.com\/downloads\/get\/880661\">Adventure Works 2014 Full Database Backup.zip<\/a>&#8216; and place it in your server backup folder. You can check where this is in SQL Server Management Studio by right clicking your server name and then &#8216;Properties&#8217;. Go to &#8216;Database Settings&#8217; to find all default\u00a0paths.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2015\/09\/Day_0_Server_Properties.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-34\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2015\/09\/Day_0_Server_Properties.png\" alt=\"Day_0_Server_Properties\" width=\"590\" height=\"530\" srcset=\"https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2015\/09\/Day_0_Server_Properties.png 704w, https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2015\/09\/Day_0_Server_Properties-300x269.png 300w, https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2015\/09\/Day_0_Server_Properties-150x135.png 150w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><br \/>\n<\/a><\/p>\n<p>Take notes of the three paths you have under &#8216;Database default locations&#8217; because we&#8217;re going to need them later.<\/p>\n<p>First extract the zip file\u00a0in the backup folder and open a new query where you have to write the following RESTORE database statement.<\/p>\n<pre class=\"brush: tsql; title: ; notranslate\" title=\"\">\r\n\r\nRESTORE DATABASE [AdventureWorks2014]\r\n\t-- This path should be YOUR Backup default path\r\n\tFROM DISK = 'C:\\Program Files\\Microsoft SQL Server\\MSSQL12.MSSQL2014\\MSSQL\\Backup\\AdventureWorks2014.bak'\r\n\t-- This path should be YOUR Data default path\r\n\tWITH MOVE 'AdventureWorks2014_Data' TO 'C:\\Program Files\\Microsoft SQL Server\\MSSQL12.MSSQL2014\\MSSQL\\DATA\\AdventureWorks2014_Data.mdf'\r\n\t-- This path should be YOUR Log default path\r\n\t\t, MOVE 'AdventureWorks2014_Log' TO 'C:\\Program Files\\Microsoft SQL Server\\MSSQL12.MSSQL2014\\MSSQL\\DATA\\AdventureWorks2014_Log.ldf'\r\n\r\n<\/pre>\n<p>Once you execute this successfully, the database AdvntureWorks2014 should be available for you to start using it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guide to explain how get AdventureWorks sample database and install it in your environment&nbsp;I wasn&#8217;t planning writing this post, because there are tons of resources available on the internet, but since I&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[7,8,6,5],"_links":{"self":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":1,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts\/33\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}