Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an MDF file? [closed]

People also ask

How do you open an MDF file?

Since MDF files are SQL server Database files which are basically log files, hence there really is no way to open them. The only way is to attach them. As soon as you attach them, you can see its database in object explorer of SQL Server Management Studio(SSMS).

What does MDF file mean?

MDF stands for Main Database File and contains all the information in a database. LDF records all the transactions and changes to the database.

What program will open MDF files?

Aside from Alcohol 120%, these files are also used by other CD burners such as MagicISO, Daemon Tools, PowerDVD as well as the IsoBuster. MDF files can be opened by these applications but the application called H+H Software Virtual CD can also open MDF files.


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.


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.