Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Move db with multiple .NDF's ?

Author  Topic 

loiter99
Starting Member

38 Posts

Posted - 2004-07-14 : 08:38:22
Hello,
I have a developer that put the MDF on one drive and the NDF's on a separate drive with the log files. I want to move the NDF's to the drive with the MDF.

I have the sp_detach_db and sp_attach_db, however, I can't find an example that shows moving multiple files. Is it as simple as:
-------------
sp_attach_db 'mydb', "c:\mydb.mdf" "c:\mydb_1.ndf", "c:\mydb_2.ndf", "c:\mydb_3.ndf","c:\mydb_4.ndf", "c:\mydb.ldf", "c:\mydb_2.ldf"
--------------

Thanks
J

MuadDBA

628 Posts

Posted - 2004-07-14 : 09:08:42
look up ALTER DATABASE MOVE FILE command, it will do it without detaching. But if you use the attach method, then yes, you detach, move the files to where you want, then re-attach.
Go to Top of Page
   

- Advertisement -