views:

25

answers:

2

Well, the subject heading essentially says it all: what's the difference between a SQL Server database file (.mdf) and an actual SQL Server database? Also, a couple of follow-up questions:

Do database files exist for both SQL Server 2008 Express and SQL Server 2008 R2? Is there a difference between those if they do?

When uploading a site that has a db file, will it automatically hook up with the db running on the server? Would it need the db's connection string info?

A: 

The "database" here probably refers to the set of programs and services you send queries to and receive resultsets from. The .mdf file is where the data is actually stored. The database program reads the database file.

I'm pretty sure the Express editions have the same architecture (data in an MDF file). It's possible (though I'm not really sure) there may be differences in the internal structure of the file between editions of the program.

Not sure about the answer to the third question, but usually instaling the database is a separate process from simply uploading the site (in my experience).

FrustratedWithFormsDesigner
+1  A: 

MDF and LDFs are used by Express and full versions of SQL. Have a look here

Upload a MDF - no, in general a Database will need to be Specifically attached to the server or restored from backup, but the one exception is which can be attached in SQL Express via AttachDbFilename.

Express MDF's and LDF's can be attached in the full versions of SQL, although the reverse is not necessarily true - Express has limitations such a size limitation and features like Indexed Views aren't available in Express.

nonnb
I have SQL Server 2008 R2 running on my production server. Would the automated publish functionality in VS 2010 attach one of these files for me, or would I have to manually specify it? I guess my confusion stems from how a project solution is mapped out in VS compared to how it needs to be laid out on the server.
kevinmajor1
If you need a copy of the Prod Database on your Dev / local environment, would suggest that you backup / restore (detaching a production db to copy it would be unthinkable)But going the other way round, I wouldn't ever publish directly to your prod database. Deploy to a Dev or QA environment from VS and then script the changes between QA and Prod using a tool like Redgate SQLCompareI haven't looked at VS2010 yet, but in VS2010 database projects .dbproj allow you to manage your DDL and proc changes under version control. You typically don't want to upload dummy test data to prod
nonnb
My version of VS (2010 Professional) doesn't allow me to create a Database project, AFAIK. No database project category is even listed when I click 'New Project...'
kevinmajor1

related questions