Steps to Attach
& Detach Database.
Attach & Detach .mdf and .ldf files:
the steps mentioned below:
- Open Sqlserver
Management Studio and select the database
from the databases tree view and right
click on the selected database which you want to Detach.
All tasks > Detach Database from the drop down menu options
- Following Dialog
box will appear.
- The following dialog box will appear prompting for MDF file location
- Click on add and select mdf and ldf files which were stored.
- Select the Data based and On Clicking
‘OK’, the data base will be attached