Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move DB files

Status
Not open for further replies.

cl1

MIS
Oct 9, 2000
15
US
What is the easiest / correct way to move a Database's .mdf & .ldf to a different volume on the same server. Presently everything is on the "C:" drive and I need to move the files to another physical drive "D:" fot this quickly growing DB. I know that I can use enterprise manager to backup the Database, then delete the Database, then restore the Database and select file locations in the options screen. BUT there must be a better way..

Thank's in advance
 

Use sp_detach_db to detach the files from SQL Server. Move them to the new location. Use sp_attach_db to attach the files.

Both procedures are well documented in SLQ BOL. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top