sql-server-2008filegroup

How do i move a table to a particular FileGroup in SQL Server 2008


I've just created a secondary filegroup and wish to move some tables over to it and then make it read-only.

I'm not sure how to do this?

do i just use the ALTER blah blah TO MyFileGroup ?


Solution

  • Something like this should help:

    CREATE UNIQUE CLUSTERED INDEX PK_YourTableName 
        ON dbo.YourTableName(YourPKFields)
        WITH (DROP_EXISTING = ON) ON [NewFilegroup]