Search This Blog

Showing posts with label SAMPLE DATABASE. Show all posts
Showing posts with label SAMPLE DATABASE. Show all posts

SQL Server 2012- Sample Databases


I was not able to find the sample databases for SQL server 2012 as most of the sites I have visited have only 2000  sample databases which we will be not able to restore to 2012. Here I have uploaded the link 2012 sample .bak files. (Easy to restore to 2012)
Pubs, Adventure Works, North Wind  -Download
Once you load up the script into SSMS and refresh the databases tree item, you will see a new database called cte_demo that includes 2 tables.
CTE_DEMO_SCRIPT

dbo.Departments

The first table is called dbo.Departments and it contains 17 rows with a number of store departments with the top level departments being indicated by a parent of NULL, and subdepartments having actual parent ID’s.
CTE_DEMO_dbo_departments

dbo.Royalty

The dbo.Royalty table contains several generations of the British Royal Family family tree. We will use these for some interesting hierarchical queries.
CTE_DEMO_dbo_royalty

Stored Procedures

This database also includes 2 stored procedures to rebuild the Departments table as we will be changing data in that table as we test different scripts.

Downloadable Scripts

Download one of the following scripts and run it in SQL Server Management Studio to set up the CTE_DEMO database for use in several samples.
This script is intended to be run on a test or development server and is not intended to be run on a production system.


How to Install Sample Databases in SQL Server 2008 R2


How to install sample databases in SQL Server 2008 R2?. Sample databases are really helpful,  when you want to practice what you have learnt in SQL Server be it from a text book or an online article, blog etc sample databases are readily available to test. Knowing that it is easy to start from scratch on these sample databases makes you play with and even try some things that you would not want to do on other databases. Database and Log file shrinking (which is not suggested on user databases) but in order to learn such topics, your best choice is a sample database. With that lets focus on our goal (Installing the sample databases, if you have already forgotten…)
The first step is downloading the sample database. Visit the Microsoft Database Product Samples website and choose the sample database for the version that you want. Since we are dealing with SQL Server 2008 R2 he is the linkOnce you have downloaded the file (approx 80 MB). Go to the location where the downloaded file is residing. Right click on the file AdventureWorks2008R2_SR1.exe (if you have not renamed it) and select Open; you can also double click on the file.
The exe file starts extracting to a temporary location on your local drive and once the extraction is done, the SQL Server 2008R2 SR1 Database Installer is displayed. The below screen is the first screen in which you have to accept to the license terms. Choose the check box and click Next.
In the next screen, it will displays on which database Instance the Sample databases will be added. If you have multiple instances on the machine, you can choose the Instance name from the drop down list.
Note that for some databases there are warning (yellow triangle with exclamation) icon being displayed, those databases cannot be installed through this installed but they can be added manually using Business Intelligence Developer Studio. You can click more information to find details on how to perform that task.
By default all sample databases that can be added, will be selected, you can un-check those databases that you would not want to install. Once you are done, clickInstall
The installation of sample databases progress is displayed, you can click Show Details button to view the detailed information in text format..
Once the installation is done, the progress bar indicates that installation is complete.. Click Finish to close the Installer.