How can I move a table to another filegroup in MS SQL Server?

后端 未结 8 2000
星月不相逢
星月不相逢 2020-12-07 13:04

I have SQL Server 2008 Ent and OLTP database with two big tables. How I can move these tables to another filegroup without service int

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 13:48

    Partitioning is one solution, but you could "move" the clustered index to the new filegroup with no service interruption (subject to some conditions, see link below) using

    CREATE CLUSTERED /*oops*/ INDEX ... WITH (DROP_EXISTING = ON, ONLINE = ON, ...) ON newfilegroup
    

    The clustered index is the data and this is the same as moving filegroup.

    Please see CREATE INDEX

    This depends on if your primary key is clustered or not, which changes how we'd do it

提交回复
热议问题