DBA Tips Archive for SQL Server
No Title[an error occurred while processing this directive]
by Jeff Hunter, Sr. Database Administrator
To facilitate the SQL Server 2012 articles and scripts on the iDevelopment.info website, all of the examples are based on the AdventureWorks for SQL Server 2012 sample databases. These sample databases are part of the AdventureWorks Community Sample Databases. This guide presents the steps required to download and install the AdventureWorks2012 and AdventureWorksDW2012 sample databases found in the AdventureWorks Community Sample Databases package for SQL Server 2012. The example SQL Server 2012 instance used in this guide is running on Windows Server 2012.
Starting with SQL Server 2005, the Northwind and Pubs sample databases are not installed by default due to security concerns. These sample databases have been replaced with AdventureWorks. Users are required to download and manually install the AdventureWorks sample databases after successfully setting up SQL Server. All sample databases can be downloaded from Microsoft's SQL Server sample website at http://msftdbprodsamples.codeplex.com/.
The following sample databases are available as part of the AdventureWorks Community Sample Databases for SQL Server 2012:
SQL Server code samples and sample databases are hosted on CodePlex. CodePlex is Microsoft's free open source project hosting site. Users can create projects to share with the world, collaborate with others on their projects, and download open source software. The portal page for SQL Server on Codeplex catalogs samples included with Product Releases, samples from the community, and independent SQL Server Community projects.
Visit the SQL Server Samples and Community Projects page on CodePlex at: http://codeplex.com/SqlServerSamples.
CodePlex is hosted by Microsoft. Microsoft does not control, review, revise, endorse or distribute the third party projects on the CodePlex site. Microsoft hosts the CodePlex site solely as a web storage site as a service to the developer community.
As mentioned at the beginning of this article, the Adventure Works for SQL Server 2012 sample databases must be manually downloaded and installed. All sample databases can be downloaded from Microsoft's SQL Server sample website at http://msftdbprodsamples.codeplex.com/.
For the purpose of this guide, download the following sample databases for SQL Server 2012 to one of your SQL Server data file folders.
Mar 14, 2012 (193536K)
Mar 12, 2012 (206080K)
In this example, I downloaded the data files to G:\MSSQL\Data\.
Other sample databases and tutorials included with Adventure Works for SQL Server 2012 can be found at http://msftdbprodsamples.codeplex.com/releases/view/55330.
Perform the following steps to install the Adventure Works for SQL Server 2012 sample databases downloaded in the previous section.
From SQL Server Management Studio, open a New Query window or use SQLCMD to execute the code below to attach the sample databases to your SQL Server 2012 instance. Notice that the download file for each database only included the data file (MDF) and not the log file (LDF). In order to build a new log file, use the ATTACH_REBUILD_LOG option when attaching the databases.
You can safely ignore the following warnings when attaching the sample databases:
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.
Copyright (c) 1998-2017 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at firstname.lastname@example.org.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
Last modified on
Saturday, 23-Mar-2013 20:58:01 EDT
Page Count: 19766