Difference between Primary key Constraint and Unique key Constraint in SQL Server
hi,
Difference between Primary key Constraint and Unique key Constraint in SQL Server. Unique Key Constraint:The column values should retain uniqueness.It allows null values in the column.It will create non-clustered index by default.Any number of unique constraints can be added to a table.
Primary Key Constraint:Primary key will create column data uniqueness in the table. It Wont allow Null values.By default Primary key will create clustered index.Only one Primary key can be created for a table.Multiple columns can be consolidated to form a single primary key
Regards
Switin
Difference between Primary key Constraint and Unique key Constraint in SQL Server. Unique Key Constraint:The column values should retain uniqueness.It allows null values in the column.It will create non-clustered index by default.Any number of unique constraints can be added to a table.
Primary Key Constraint:Primary key will create column data uniqueness in the table. It Wont allow Null values.By default Primary key will create clustered index.Only one Primary key can be created for a table.Multiple columns can be consolidated to form a single primary key
Regards
Switin
Comments
Post a Comment