Schema - Do you create primary key on your tables?

Last updated by Brady Stroud [SSW] about 1 month ago.See history

When you specify a PRIMARY KEY constraint for a table, SQL Server enforces data uniqueness by creating a unique index for the primary key columns. This index also permits fast access to data when the primary key is used in queries. Although, strictly speaking, the primary key is not essential - we recommend all tables have a primary key (except tables that have a high volume of continuous transactions).

Figure: Bad Example - Table missing primarykey

Figure: Good Example - Table with primary key

Legacy:

Especially, when you have a client like Access, it would help you to avoid the problems.

Adam Cogan
We open source. Powered by GitHub