Primary Key and Unique Key

Primary Key and Unique Key

1) Only 1 Primary key can be defined in one table while as unique key can be defined more than 1 in a table

2) Primary never accept null value while as Unique key can accept multiple null values

3) On the creation of Primary Key,clustered index created on table while as On the creation of Unique Key ,non-clustered index created on table

4) Primary key is used for identify a record while a Unique key is used to prvent duplicate records in a table





No comments:

Post a Comment