Hemant_Singh
Hemant_Singh

Reputation: 25

Creating a Columnstore Index

Is it possible to create a column store index on a table in sql which already has a clustered index & non clustered index over it

Upvotes: 2

Views: 5711

Answers (1)

Nikolay Fedorov
Nikolay Fedorov

Reputation: 387

Yes it's possible. Example:

CREATE TABLE SimpleTable
(ProductKey [int] NOT NULL, 
OrderDateKey [int] NOT NULL, 
DueDateKey [int] NOT NULL, 
ShipDateKey [int] NOT NULL);
GO
CREATE CLUSTERED INDEX cl_simple ON SimpleTable (ProductKey);
GO

CREATE NONCLUSTERED INDEX noncl_simple ON SimpleTable(OrderDateKey);
GO

CREATE NONCLUSTERED COLUMNSTORE INDEX csindx_simple
ON SimpleTable
(OrderDateKey, DueDateKey, ShipDateKey);
GO

Upvotes: 3

Related Questions