Monday, September 24, 2012

How to detach and attach database on SQL Management Studio Express

How to detach and attach database for software on SQL Management Studio Express??

I am using my Test software as ACR


1. Open SQL server management studio express
Break Databases Tree
Right click on ACR
Select properties (Database Properties - ACR dialogue box will open up)
Select Files
Get database file path for ACR.mdf and ACR_log.LDF

2. Right click on ACR and select task
Select detach
Check Drop Connections and Ok (this immediately removes ACR from Databases)

3. Go to database file path
Select and cut ACR.mdf and ACR_log.LDF files
Create a folder (e.g. ABC_ACRSQLData) on the secondary Hard Drive and paste above files

4. Right click on Databases and select attach
Click on Add
Select and break ABC_ACRSQLData
Select ACR.mdf and hit OK


To confirm the change:
Right click on ACR
Select Properties
Select Files
Verify database files path

No comments:

Post a Comment