Difference between Primary key Constraint and Unique key Constraint in SQL Server. - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, April 14, 2012

Difference between Primary key Constraint and Unique key Constraint in SQL Server.

Difference between Primary key Constraint and Unique key Constraint in SQL Server.

Unique Key Constraint: 
The column values should retain uniqueness. 
It allows null values in the column. 
It will create non-clustered index by default. 
Any number of unique constraints can be added to a table. 

Primary Key Constraint: 
Primary key will create column data uniqueness in the table. 
It Wont allow Null values. 
By default Primary key will create clustered index. 
Only one Primary key can be created for a table. 
Multiple columns can be consolidated to form a single primary key. 

No comments:

Post a Comment