This article demonstrates how to add a primary key to an existing table in SQL Server using Transact-SQL.
A primary key is a column that has been configured as the unique identifier for a given table.
You would normally create a primary key constraint when you create the table, but you can also add a primary key to an existing table.
Note that a table can only have one primary key. So you can’t add a primary key if the table already has one.
Also primary keys can only be added to columns that are defined as NOT NULL
.