Sql-server – Slide Partition from Rowstore to Columnstore

columnstorepartitioningsql serversql server 2014

I have a rowstore table which contains ~10 billion records. The table is partitioned on an INT field and has about 1,400 active partitions. I also have a clustered columnstore table built on the same Partition Scheme / Function. Can I switch an active partition from the Rowstore table to the Columnstore table?

ALTER TABLE [dbo].[RowstoreTable] SWITCH PARTITION 741 TO [dbo].[ColumnstoreTable] PARTITION 741

This database resides on SQL Server 2014 Enterprise Edition.

Best Answer

No, this is not possible. ALTER TABLE... SWITCH is a metadata operation and both tables need to have identical schemas. There's no such thing as a partitioned table that has some columnstore partitions and some rowstore partitions.

The best you can do is switch the rowstore partition out, build a clustered columnstore index on the switched out table, and then switch that table into the columnstore table.