Let's say I have some table T
with some non-null field A
. There is a clustered index on A
. Consider the following two options:
- I make
A
the primary key. - I create a UNIQUE constraint for
A
.
Where's the difference? I know what a primary key is, and I know that there is a conceptual difference w.r.t. database theory. But what is the actual difference in SQL Server? How does the SQL Server database engine behave differently? In both cases, the clustered index of the table is on A
; and in both cases I can refer to A
through foreign keys.
(Related question which inspired this question: Meaning of Primary Key to Microsoft SQL Server 2008)