SQL Server 2008: First Impressions, Page 2
- Next, you'll need to use SQL Server Configuration Manager to enable the FileStream option for the selected instance—it's disabled by default. To enable it, navigate to the specific SQL Server 2008 instance, right click, and choose "Properties." Note the new tab to control the FILESTREAM option. No, I doubt if you'll need to enable as much as I did, but let your DBA make that call.
Figure 3: Enabling the FileStream option.
- At this point, you need to decide (if you haven't already) which of the six sample AdventureWorks databases you want to install. The command batch you're about to run simply uses XCOPY to copy one (and only one) of the sample AdventureWorks directories to another target path and runs an install script from that folder. This script subsequently creates the chosen sample AdventureWorks database and loads the data to a selected SQL Server 2008 instance. Note that you'll have to repeat the BuildAdventureWorks.cmd batch for each of the databases you want to install. In the end, you'll end up with the data in at least two places—where the MSI wrote it (in the ..\Tools\Samples\ directory) and in the "common" DATA directory targeted by the Command batch.
Note that SQL Server 2008 has changed the way that the instances are referenced in the Program Files tree. This makes sense because it now permits admins to clearly see the purpose of the directory and the version of SQL Server. In my case, where the instance name is SS2K8, the target path for the awdb files should be: C:\Program Files\Microsoft SQL Server\MSSQL10.SS2K8\MSSQL\DATA.
- To keep this simple, I didn't follow the instructions given in the Command batch. If you do, you'll have to manually copy the files again because the install script it executes has the SQL Server 2008 instance common directory hard-coded.
I ran the BuildAdventureWorks.cmd batch from a Command prompt as follows:
C:\Program Files\Microsoft SQL Server\100\Tools\Samples> buildadventureworks.cmd "C:\Program Files\ Microsoft SQL Server\MSSQL10.SS2K8" "betav1\ss2k8" "AdventureWorks2008"
This installed the AdventureWorks2008 OLTP database.
- You need to pass three arguments:
- The path to the "common" data path for your newly installed SQL Server 2008 instance.
- The server\instance name to be used to open a connection.
- The name of the sample database to install from the batch file names shown in Figure 4.
- You might want to repeat the batch for each of the sample databases. Figure 4 shows the name you need to use to install each of the databases.
Batch File Name Use File Path (files copied here) AdventureWorks General OLTP examples \DATA\AWDB AdventureWorks2008 2008 OLTP examples \DATA\AWDB2008 AdventureWorksDW Data warehouse examples \DATA\AWDWDB AdventureWorks2008DW 2008 Data Warehouse... \DATA\AWDWDB2008 AdventureWorksLT Lightweight database \DATA\AWDBLT AdventureWorks2008LT 2008 Lightweight database \DATA\AWDBLT2008
Figure 4: Mapping the sample databases to the file location.
In my case, I passed in the newly installed instance "common root path" and specified the instance name as shown above. No, I could not get the suggested ".\<instance name>" to work, but the explicit reference worked fine. Note that if you don't specify a sample database to install, the command batch installs the "AdventureWorks" (non-SQL Server 2008) OLTP example database.
For more instructions, go to http://www.codeplex.com/MSFTDBProdSamples/Wiki/ View.aspx?title=AW2008Details&referringTitle=Home and skip down to "AdventureWorks 2008" Installation.
|Incidentally, I'm told that some of the spatial data for the AdventureWorks database is a bit off. For some reason, some of the Texas stores are plotted out in the middle of the Pacific Ocean. Perhaps these are offshore oil rigs.|
If I were king, I would have had an interactive application that let developers choose which sample database(s) they wanted and just installed them. Gee, that might be a job of the setup tool—like it used to be. There was plenty of room left on the DVD.
I hope this helps get you started with SQL Server 2008. A lot has changed with this version. Although I'm disappointed that these revisions are coming so fast, perhaps there are those of you who are really looking forward to the extra functionality it provides. Of course, I don't expect the adoption rate for SQL Server 2008 to reach 50% for another few years—many folks are just now transitioning to SQL Server 2005.
About the Author
William (Bill) Vaughn is an industry-recognized author, mentor, and subject-matter expert on Visual Studio, SQL Server, Reporting Services, and data access interfaces. He's worked in the computer industry for over thirty-five years—working with mainframe, minicomputer, and personal computer systems as a developer, manager, architect, trainer, marketer, support specialist, writer, and publisher. In 2000, after 14 years at Microsoft, Bill stepped away to work on his books, mentoring, and independent training seminars. He's written seven editions of the Hitchhiker's Guide to Visual Basic and SQL Server and three editions of ADO.NET and ADO Examples and Best Practices for Visual Basic (and C#) Programmers. He and Peter Blackburn also wrote the critically acclaimed Hitchhiker's Guide to SQL Server 2000 Reporting Services.
Bill is a top-rated speaker and frequents conferences all over the world, including TechEd, Visual Studio/SQL Connections, DevTeach, and many others. He's also written a wealth of articles for magazines such as MSDN, SQL Server Magazine, Visual Basic Programmer's Journal, .NET Magazine, and many others as well as a regular editorial for Processor magazine. Bill spends considerable time answering questions on the public newsgroups and speaking at INETA user group meetings all over the country and at other speaking venues all over the world. He's available for consulting, mentoring, or custom training. See www.betav.com or www.betav.com/blog/billva for his current schedule and course catalog.