Detaching a Database in SQL Server

 

Right click the database that you wish to detach

 

Highlight “All Tasks”

 

Click “Detach Database…”

 


A confirmation dialog will appear, click “OK” button

 

A completion dialog will appear, click “OK” button

 

 

Your database should now be detached and ready to copy
Attaching a Database in SQL Server

 

Right click “Databases” folder

 

Highlight “All Tasks”

 

Click “Attach Database…”

 


Click on the button with “…” to locate the database

 

Browse to your database, mine is in

“C:\Program Files\Microsoft SQL Server\MSSQL\Data\KAPMCAR_Data.MDF

 

Select the Database and click “OK” button

 

Make sure the information that is now entered in the text fields is correct

 

Click “OK” button

 

 

A confirmation dialog will appear, click “OK” button

 

Provided all the information is correct, your database will now be attached