Primary Key vs Unique Key in Database Table
By Santhosh N
This explains the differences between Primary Key and Unique key in the Table of Databases like Oracle, SQL Server, etc...
Following are the major differences between Primary Key and Unique key:
1) Both
Primary Key and Unique Key imposes unique values in the columns but Primary Key does not allow NULL values where as Unique Key allows one value to be NULL as it is treated as unique among the possible column values.
2) Primary Key creates a clustered index on the column where as Unique Key creates non-clustered index on the column.
Related FAQs
This explains the different index configurations a SQL Server table can have
This explains how to find the current Database name in SQL Server
This explains about the maximum number of parameters allowed in Stored Procedures and functions in SQL Server 2008 R2.
This explains about the limitation of the number of columns allowed in the SELECT, INSERT and UPDATE Queries in the SQL Server.
This explains the maximum size in bytes that is allowed for keys (Primary, index and foreign keys) in SQL Server.
This explains the maximum number of columns allowed for keys (Primary, index and foreign keys) in SQL Server.
Primary Key vs Unique Key in Database Table (1320 Views)