How to Restore an MDF File on the SQL Server

How to Restore an MDF File on the SQL Server thumbnail
Mount an MDF file to restore your SQL database.

An MDF file contains all the tables, user permissions and properties for your SQL Server database. The database administrator takes a backup of the tables, views, users and other database objects in case of an emergency. Using the SQL Server Management Studio that comes with the database engine, database administrators attach the MDF file to restore the database to operation. The administrator can accomplish this using Structured Query Language (SQL) executed against the server.

Instructions

    • 1

      Click the Windows "Start" button. Click "All Programs," then click "SQL Server" in the program groups. Click "SQL Server Management Studio" to open your database console.

    • 2

      Right-lick the database server name located on the left of the screen and select "Attach." This opens a new SQL Server configuration window where you restore the MDF file.

    • 3

      Enter the MDF file's location in the "Attach Databases" dialog text box. If you don't know the location by heart, click the "Browse" button and click through the directories to locate the MDF file. Double-click the file to set the MDF file location in your SQL Server attachment settings.

    • 4

      Click "OK" to attach and restore the MDF file. It may take several minutes to complete the task. After the process completes, click the database server name on the left again. You notice the new database is located in the list of available databases on the server.

Related Searches:

References

  • Photo Credit computer image by blaine stiger from Fotolia.com

Comments

You May Also Like

  • How to Restore MDF and LDF Files

    MDF files contain all SQL Server database information. The LDF file you see alongside the MDF file is an archive of the...

  • How to Restore a SQL Database From a .MDF File

    Microsoft SQL Server is a database solution for small to large businesses. One aspect of a database server is backing up the...

  • What Is the File Extension .MDF?

    The file extension .mdf most often refers to to Media Disk Images, but can also refer to several other program data files.

  • How to Mount an MDF Image

    Virtual disc images, such as MDF images, are increasingly being used by computer consumers as they provide the ability to use replications...

  • What Is an SQL MDF File?

    Microsoft has continually released and updated its SQL Server software since 1989. The latest release was in 2008, offering multiple versions depending...

Related Ads

Featured