This documentation states "By design, a columnstore table does not allow a primary key constraint."
This doesn't appear to be true. See this example:
CREATE TABLE t_account (
AccountKey int NOT NULL PRIMARY KEY NONCLUSTERED,
AccountDescription nvarchar (50),
AccountType nvarchar(50),
UnitSold int
);
CREATE CLUSTERED COLUMNSTORE INDEX t_account_cci ON t_account ;
This executed fine in SQL 2017. I think what the documentation intends to say is that the table cannot have a clustered primary key, since the table is a clustered columnstore index.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@samrueby -- Sam, thank you for your feedback and your researches.
@MikeRayMSFT -- please look into this issue 3938.
@samrueby - thanks for the submission. Verifying.
Fixed by adding "clustered". Does not allow a clustered PK.