First of all, the primary key is also called the PRIMARY KEY constraint, which is also a constraint, look at it and the creation syntax of the UNIQUE constraint:
ALTER TABLE person add constraint pk_id primary key (ID)
ALTER TABLE person add constraint uq_name unique (Name)
Both primary keys and unique constraints require field values to be unique, except in addition to the following differences:
• The same table can have only one primary key, but can have multiple unique constraints;
• The primary key field value cannot be null, and the unique constraint field value can be null;
• Primary key fields can be foreign keys to other tables, and unique constraint fields cannot be foreign keys to other tables;
· SQL Server creates a clustered index on the default primary key field, creating a nonclustered index for the unique constraint field;
Primary key, unique, but cannot be null; Unique constraint, unique, but nullable