How can I create a File Group on a different drive with MSSQL 2005 and then move a table into it?
Ex: my database is on H:\Product.mdf and H:\Product.ldf
I want to create a new file group on F:\FileGroup\ and then move my table with a clustered index to this new file group.
This is not a simple task, and depending on the size of your tables may require a chunk of downtime.
First, you have to define the new file group:
Then, create an appropriate file for that file group, for example:
To move a table onto the file group, you have to create a clustered index for that table on the file group. If you’ve got a clustered constraint (such as a unique or primary key), you’ll have to drop it first. Here’s one way to move such a table:
It is just a bit fussy, so be sure to test everything on copies of your databases first!