Enjoy Every Sandwich

Thoughts on SQL, XML, .NET and sometimes beer.

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456


Navigation

Tools

List O'Links

Kent's Other Stuff

Subscriptions

News

Please read these
Notices and Disclamiers

Post Categories

Article Categories



Installing the AdventureWorks DB on SQL Express

Some people just seem to think it's just terrible that the sample databases don't happen to ship with or install with SQL Server 2005 Express. There are basically four reasons why Microsoft chose to do this from what I can tell:

  1. You shouldn't need the sample databases in production and if the sample had a potential security exploit in them, you certainly wouldn't want that laying around (remember SQLSlammer?)
  2. Unless you know they are there, you might not think about removing them from a production instance when they don't need to be there.
  3. It would require extra disk space to hold the DBs, and would require that much more again plus some to install them.
  4. It would dramatically increase the size of the download files, something that's just not always desirable.

So rather than complain about what I feel is a good decision on MS's part, here's the easy way to get the AdventureWorks samples to install in a local instance of SQL Express.

  1. Verify that your SQL Express instance is up and running by checking that SSX is responsive.
    1. Start|Run|Cmd
    2. Type 'net start "sql server (sqlexpress)".' You should get a message that service started.
    3. Type at least 'sqlcmd -s .\sqlexpress' if you are a local administrator or add the -U and -P switches to login with a standard login that is SA.
    4. Type 'select @@version' and press enter then type 'go' and press enter. If you get results, great. If you get errors, please post them the SSX newsgroup.
    5. Type exit. We'll be back.
  2. Browse to http://www.microsoft.com/downloads/details.aspx?FamilyId=2ADBC1A8-AE5C-497D-B584-EAB6719300CD&displaylang=en and scroll down the bottom of the page. From the list of files, select 'AdventureWorksDb.msi' and save that to your disk.
  3. Run the MSI from step 2. This is just unpacking the data and the scripts for us to run in a few steps.
  4. Start|run and enter '%homedrive%\Program Files\Microsoft SQL Server 2005 AdventureWorks Sample Database Scripts\awdb' That should open the folder where the database files and scripts were installed to.
  5. Start|run|cmd, then type 'cd ' but don't press enter yet. Instead, drag the folder icon out of the address bar from the window in step four onto this shell Window, then press enter. That'll save you a bunch of typing. You should now be in the working directory for the files installed in step 3.
  6. Type 'sqlcmd -S .\sqlexpress -i instawdb.sql' (add -U and -P if you need to of course) and press enter. The script should start working away in a few seconds. Again, if you get any errors, please post them to the newsgroup.

Total install time will vary, of course, but you'll probably have time to go catch up on the newsgroups or your favorite blogs whilst this runs.

Now, that wasn't so bad, was it?

posted on Thursday, January 27, 2005 5:23 AM by ktegels





Powered by Dot Net Junkies, by Telligent Systems