将现有的Clustered columnstore索引移动到其他文件组中

时间:2017-07-20 16:37:17

标签: sql sql-server indexing sql-server-2016 clustered-index

我正在尝试将现有的Clustered Columnstore Index从一个文件组移动到另一个文件组,但找不到任何命令来执行此操作。

编码我的尝试:

ALTER TABLE CCSI ON [dbo].[t179_s1_LOSS_ByEvent_ORIGINAL_440F6776-6185-4416-89D8-B69334457B25] 
WITH ( MOVE TO FG_1 );

错误:

  

Msg 156,Level 15,State 1,Line 281   关键字“ON”附近的语法不正确。

     

Msg 319,Level 15,State 1,Line 281   关键字'with'附近的语法不正确。如果此语句是公用表表达式,xmlnamespaces子句或更改跟踪上下文子句,则必须以分号结束前一个语句。

1 个答案:

答案 0 :(得分:1)

就像聚簇索引一样,使用DROP_EXISTING在目标文件组上重新创建它。例如

create table foo(id int, a int)
create clustered columnstore index cci_foo on foo

go

create clustered columnstore index cci_foo 
on foo
with (drop_existing=on)
on fg2
相关问题