SQL Server Transact Basic to Expert - Primary Key Adding to Existing table

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)



Ebook Download
View all
Learn
View all