This article demonstrates how to create a primary key in SQL Server when creating a table using Transact-SQL.
A primary key is one or more columns that have been configured as the unique identifier for a given table. Primary keys can be used to enforce data integrity in the table.
A table can only have one primary key, and primary keys can only be added to columns that are defined as NOT NULL.
This article demonstrates how to create a primary key in a new table (i.e. when creating the table). If you need to create a primary key in an existing table, see How to Add a Primary Key to an Existing Table in SQL Server.