This blog shows how to add a primary key constraint to an existing table
Syntax:
ALter table tablename
Add Constraint(PK_tablename)
Primary Key (ColumnName)
Example:
Alter table emptable
Add Constraint(Pk_Emptable)
Primary Key(empid)
SQL Server Transact Basic to Expert - Primary Key Adding to Existing table
SQL Server Transact Basic to Expert - Primary Key Adding to Existing table


Join the conversation! Your thoughts help the community grow.