O'Reilly logo

Professional Microsoft® SQL Server® 2008 Administration by Steven Wort, Ross LoForte, Wayne Snyder, Ketan Patel, Brian Knight

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.2. Sample Database

For this chapter and the example walkthroughs, we looked at the various sample databases available; and after playing with most of them we decided that a simpler case would work just as well, be easier for readers to reproduce in their own environment, and be simpler to use to illustrate how each feature works.

Open the SQL Server solution file People.ssmssln under the downloads folder for this chapter on the book's website at www.wrox.com.

You can either build the People database using following steps or restore the People database from the backup file People.bak provided in the People folder. To build the People database:

  1. Open the script 1_CreateDatabase.sql. The FILENAME option in the CREATE DATABASE statement has the path C:\mssql\Data. Make sure that you create these folders before running the script or adjust it to the correct path according to your system. Now run the script 1_CreateDatabase.sql.

  2. Open the script 2_CreateTables.sql and run it. This script will create four tables: People, BoysNames, GirlsNames, and LastNames.

  3. Open the script 3_MakeNames.sql and run it. This script creates the stored procedure MakeNames, which is used in the next step to populate some data. This procedure has two arguments. The first is the number of names to insert (the default is 100). The second indicates which type of name to insert: a male name ("B" for Boys), a female name ("G" for Girls), or the default, a last name ("L" for LastNames).

  4. Open the script 4_Exec_MakeNames.sql ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required