What is an MDF file? [closed]
Asked Answered
E

2

152

Is this like an “embedded” database of sorts? A file containing a built in database?

Endear answered 24/7, 2009 at 5:41 Comment(3)
If you've got just an mdf file, you may find serverfault.com/questions/31105/opening-mdf-files useful.Zachar
A .mdf file might also contain an Microsoft Access database. An Access database is not a SQL server database, but indeed a more embedded type of database like a bit like e.g. SQLlite. The Access database needs no server software, just drivers. Access was more common in the 1990s but it is still updated and part of the Office package: en.wikipedia.org/wiki/Microsoft_AccessMegalocardia
I wish SO included a section for the reason a question is closed. I have no idea why this particular question was considered off topic. Is there another SO site dedicated to databases? If so why not link there. One of the biggest problems SO has is good questions with good answers being closed. Ensuring a reason has to be specified may be one way of mitigating this disease.Caucasia
H
193

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.

Hyperplasia answered 24/7, 2009 at 5:49 Comment(1)
For people like me: Q: what do the letters mean? A: MDF – It stands for Master Database File (datanumen.com/blogs/5-basic-facts-mdf-ldf-files-sql-server)Viccora
M
57

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.
Menticide answered 24/7, 2009 at 8:13 Comment(6)
How about mdf = main data file, ndf = next data file and ldf = log data file ?Hiro
@Bitterblue: Could be. May be I can use for explaining to my students ;)Timm
@Hiro Thanks a lot. Just, do we have any source for that information?Boudreau
@nowhewhomustnotbenamed. just want to say you have a funny name....Gladiatorial
@SyamsoulAzrien: lol.. inspired by harry potterTimm
mdf = master database file. @VaibhavVishal media descriptor file pertains to optical disc images, not Db files.Allenaallenby

© 2022 - 2024 — McMap. All rights reserved.