Skip to content

Commit bcd0562

Browse files
Bugfix during generation of truncate table/partition statement for columnstore indexes
1 parent 8d87774 commit bcd0562

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Server/Index.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ public string GetQuery() {
8686
sql = $"ALTER INDEX {fullIndexName} REORGANIZE PARTITION = {partition}" +
8787
$"{(FixType == IndexOp.REORGANIZE_COMPRESS_ALL_ROW_GROUPS ? $"{Environment.NewLine} WITH (COMPRESS_ALL_ROW_GROUPS = ON)" : "")};";
8888
break;
89+
90+
case IndexOp.TRUNCATE_TABLE:
91+
sql = IsPartitioned
92+
? $"TRUNCATE TABLE {objectName} WITH (PARTITIONS ({partition}));"
93+
: $"TRUNCATE TABLE {objectName};";
94+
break;
95+
8996
}
9097

9198
}

0 commit comments

Comments
 (0)