Add option for PRIMARY KEY that is NONCLUSTERED

Dixant Rai 3 months ago 0

Users should be able to create PrimaryKey tha is NONCLUSTERED. While PK flag to identify them the default should be CLUSTERED (as is the case in most RDMSs) but an option should be available to be able to create a NONCLUSTERED one as well. The resultant DDL script should result in this.

CREATE TABLE sample_table (
   sample_column int  NOT NULL,
   CONSTRAINT sample_table_pk PRIMARY KEY NONCLUSTERED (sample_column)