Sep 7, 2011 at 11:38 PM
Edited Sep 8, 2011 at 12:00 AM
Okay, I've done some research here and I think I know what’s going on.
First, both of the MDF files should get pulled down with the source. If they aren't in the App_Data directory, please try to download them again from the source repository. It's not necessary to explicitly attach these MDF files to the SQL Express instance.
The connection string specifies ‘User Instance’ and ‘AttachDBFilename’ properties which spin up a runtime-initiated instance of the MDF file.
Next, If you're getting this error:
"The database 'NERDDINNER.MDF' cannot be opened because it is version 661. This server supports version 662 and earlier. A downgrade path is not supported.Could not open new database 'NERDDINNER.MDF'. CREATE DATABASE is aborted.
(Microsoft SQL Server, Error: 948)"
You have SQL Express 2008 SP2 installed and not SQL Express 2008 R2. Really the way this error should read is:
"The database cannot be opened because it is version 661. This server supports versions 662, 655 and earlier than 655. A downgrade path is not supported."
My understanding is that SQL Server 2008 SP2 and SQL Server 2008 R2 databases are not interchangeable because a feature introduced in SP2. Part of the confusion, for me, is with the version numbers. R2 is the 'latest and greatest', but has a lower
data format version #. Here's a table of the various versions of SQL Server 2008 and their data format version #s.
• SQL Server 2008 R2 (v 10.50.1600) data format version # 661
• SQL Server 2008 SP2 (v 10.00.400) data format version #662
• SQL Server 2008 (v 10.00.1600) data format version #655
The MDF files included in the Nerd Dinner source are from SQL Express 2008 R2. If you find that you don't have R2 installed there are two ways of remedying this scenario, first would to be to upgrade the SP2 instance to R2. Or you could manually build out
the DB on SP2, in which case you would need to build some mechanism of importing the schema.
Here a link to my blog post on this subject along with the SQL Schema scripts for building your own DBs.