Friday 2 November 2012

Moving the SQL Server Database to another Drive


Please follow these simple steps to move database from c drive to another drive on Microsoft SQL server 2008 using detach and attach methodfrom Microsoft SQL Management Studio GUI


1- Open Microsoft SQL Management Studio with administrative account.

2- R/Click on the DataBase you want to move and select Tasks Detach.

3- In the Detach screen check drop connections check box to drop any active connections before detach the database.

4- click ok to begin detach the database.

5- after successful database detach navigate to database file  location "database.mdf" and database log "database.ldf".

6-  Copy files to the destination directory that you want to move database to it.

7- Set NTFS permissions for the Moved database and log files as the source database.

8- From SQL Management Studio R/Click database and select attach database

9- From the attach window select database files from the new location "database.mdf" and logfile "database.ldf"

10- Click Ok and the database is now attached from the new location.

11- Delete the old database files if you don't need them.

No comments:

Post a Comment