Sql-server – Creating additional indexes on a table with a columnstore clustered index

columnstorenonclustered-indexsql serversql-server-2016

According to this article, a table with a clustered columnstore index can have one or more additional non-clustered indexes. However, when I try to add a non-clustered index on a table with a CCI, I get the error shown in the image below:

enter image description here

Am I overlooking something, or misinterpreting something? I'm using SQL Server 2016 with SP1.

Best Answer

You can create additional nonclustered indexes on tables with clustered columnstore indexes, the following script shows this...

CREATE TABLE dbo.T2 (C1 INT NOT NULL, C2 INT, C3 INT);
GO
CREATE CLUSTERED COLUMNSTORE INDEX CCI ON dbo.T2;
GO
CREATE NONCLUSTERED INDEX IX ON dbo.T2 (C2);
GO

I have attempted the same thing using SSMS 16.5.3. It is possible that there is a bug in the version you are using (latest is at https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms ).

Consider creating the script using TSQL rather than the GUI to see if you get the same result.