Is this like an "embedded" database of sorts? A file containing a built in database?
Yeah you're close. It's a Master Database File used to store some of the system information and sensitive data regarding the database.
A quick google search shows MSDN has a very descriptive page on it.
Hope this helps.
SQL Server databases use two files - an MDF file, known as the primary database file, which contains the schema and data, and a LDF file, which contains the logs. See wikipedia. A database may also use secondary database file, which normally uses a .ndf extension.
As John S. indicates, these file extensions are purely convention - you can use whatever you want, although I can't think of a good reason to do that.
More info on MSDN here and in Beginning SQL Server 2005 Administation (Google Books) here.
This is a "master" database?
That doesn't make sense to me. If I open up a new project for an ASP.NET "webSite", and I add an App_data folder, and I add a database to this folder, the file that is created is a .mdf file. I can add any tables relevant to the application and query them. These tables don't have any system information. I'm sorry if I wasn't clear enough in my question.
When I add tables to this .mdf file, they're relevant to my application and I query this file instead of a SQL Server db.
Just to make this absolutely clear for all:
A .MDF file is “typically” a SQL Server data file however it is important to note that it does NOT have to be.
This is because .MDF is nothing more than a recommended/preferred notation but the extension itself does not actually dictate the file type.
To illustrate this, if someone wanted to create their primary data file with an extension of .gbn they could go ahead and do so without issue.
To qualify the preferred naming conventions:
- .mdf - Primary database data file.
- .ndf - Other database data files i.e. non Primary.
- .ldf - Log data file.