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:
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.
Open the script 2_CreateTables.sql and run it. This script will create four tables: People, BoysNames, GirlsNames, and LastNames.
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).
Open the script 4_Exec_MakeNames.sql ...