The process of installing the example databases is a bit more complicated. Before getting started, you're going to want to choose a SQL Server instance to host one or all of the example databasesthere are six of them in the Databases folder on the DVD, as shown in Figure I.2. Figure I.2. The "Databases" directory on the companion DVD.
No, you won't be able to attach the database files to SQL Server while they're on the DVDyou'll have to copy them to the system that's hosting your target SQL Server instance. Check with your DBA or whomever is managing your SQL Server instancesor look in the mirror and ask yourself if you have room for these databases on an existing instance. Perhaps, you should install a separate SQL Server instance to use as a test database. SQL Server Express is included with all versions of Visual Studioany or all of the databases and examples can be executed against a stand-alone SQL Server instance. I don't recommend using Visual Studio Express and simply adding any of these databases to your projects. No matter which version of SQL Server you choose to use, you'll still have to configure it to support CLR procedures (if this makes sense to your DBA) and network visibility, as discussed in the book. I don't suggest that you install these sample databases on a production server or one that can't tolerate the extra load. Tip Don't install these sample databases on a production server or one that can't tolerate the extra load. Attaching the Example DatabasesOnce the .MDF and .LDF files for each database you wish to install are copied to a (nonremovable) drive on the host system, you're ready to attach the databases. Let's take a quick look at the databases included on the DVD and listed in Figure I.2.
I suggest installing just the NewBiblio_Data.MDF (Biblio) database until you're ready to work with the more advanced portions of the book. While I've included a SQL script to attach all of these databases on the DVD, I suggest you use SQL Server Management Studio (or the Express edition) to attach the selected databases. While I discussed how to do this in Chapter 2, "How Does SQL Server Work?", remember that you simply right-click on "Databases" in the Object Explorer and choose "Attach". The dialog prompts you for an .MDF file location. SQL Server Management Studio automatically searches for the .LDF file and attaches both to SQL Server when you click "OK." Establishing an Alias to Your InstanceAll of the example applications reference the target SQL Server via an Alias of "DemoServer". This permits you to point to any named instance of SQL Server in the ConnectionString by using another namethus, "Alias". Creating an alias is very simplejust follow along:
|