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:
- 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?)
- 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.
- It would require extra disk space to hold the DBs, and
would require that much more again plus some to install them.
- 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.
- Verify that your SQL Express instance is up and running by
checking that SSX is responsive.
- Start|Run|Cmd
- Type 'net start "sql server (sqlexpress)".' You should
get a message that service started.
- 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.
- 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.
- Type exit. We'll be back.
- 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.
- Run the MSI from step 2. This is just unpacking the data
and the scripts for us to run in a few steps.
- 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.
- 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.
- 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?