This function attaches the database files: an MDF file and an LDF file. They are usually stored automatically in C:\Program Files\Microsoft SQL Server\MSSQL\Data.
You can change this location to keep the database files away from drive C:. They are usually saved on another drive in a folder named DBFILES.
- Purpose and Contents of the Two Files:
1. MDF: This file stores database information, including the rows, columns, fields and data created by an application or user. It stores new entries and the effects of updates and deletions involving one or more records.
2. LDF: As changes are made to the MDF file, the LDF transaction log records database operations to support recovery and transaction management.
Open this window from File > Attach Database.
.