Hi, I want to have table with 1 PK and 1 Clustered Index on Column2 and Id, this is my code:
CREATE TABLE [dbo].[Test] ( [Id] INT PRIMARY KEY NOT NULL IDENTITY(1,1), [Column2] INT NOT NULL, [Column3] INT NOT NULL, [Column4] INT NOT NULL, ); CREATE CLUSTERED INDEX IX_Test ON dbo.Test (Column2, Id);
Error: "Cannot create more than one clustered index on table..."
I know, that PRIMARY KEY automatically create Clustered index on Id.
Then I manually delete existing Clustered index, and run this code part again:
CREATE CLUSTERED INDEX IX_Test ON dbo.Test (Column2, Id);
Everything is fine, except I lost my PK on Id...
How can I leave PK on Id and create my custom Clustering Index?
Thanks,