Vijay Raj Jaiswal
Answered On : Sep 20th, 2005
Hi this is modified answer ,pls post this instead of previous which i post
Primay Key Unique key
----------- ------------------
There is only one there may be more than 1
Primary key for Unique Key in table
1 table
It can not contain It Can contain Null Value
Null value

6 Users have rated as useful.
Login to rate this answer.
kalai
Answered On : Sep 28th, 2005
Primary key creates clustered index whereas unique key creates non clustered index.primary key won't allow NULL values whereas unique key allows NULL values.

3 Users have rated as useful.
Login to rate this answer.
sugapriyaraja
Answered On : Oct 23rd, 2006
Primary Key: only one column in a table,not accepted null values.
Unique Key: More then one column in a table, null values accepted.

2 Users have rated as useful.
Login to rate this answer.
bala
Answered On : Mar 1st, 2007
Primay Key Unique key
----------- ------------------
There is only one there may be more than 1
Primary key for Unique Key in table
1 table
It can not contain It Can contain one Null Value
Null value
Login to rate this answer.
amit
Answered On : May 23rd, 2007
Primary key creates clustered index whereas unique key creates non clustered index. Primary key won't allow NULL values whereas unique key allows only one NULL values.
Login to rate this answer.
Faizal
Answered On : Jul 6th, 2007
/* Just adding to the Primary Key Explanation */
Its right that there can be only one Primary Key for a Table.
But for that Primary Key we can add more than one fields.
Ex:
ALTER TABLE emp ADD CONSTRAINT PRIMARY KEY(emp_no, dept_no, phone);
By the above, all the 3 fields make a combination of a Primary Key.
|
|
Login to rate this answer.
Primary key wont accept null values and a table can have only one primary key for a column.
Unique key accepts null values.A table can have any number of unique keys.
Login to rate this answer.
Rahul Kataria
Answered On : Oct 19th, 2007
Primary key cannot take null values but Unique can take null values
simply we can say
primary key = unique + not null
Login to rate this answer.
unique key can contains one null value
primery key can not contain null value
Login to rate this answer.
A table can have only one PRIMARY KEY where as can have numerous UNIQUE KEY . A PRIMARY KEY is a unique KEY with the extra constraint that all key
columns must be defined as NOT NULL. But unique key column can contain null value only once. If UNIQUE KEY is defined on more than one column then null values can be in the table by unique combination of those columns. Another difference is that PRIMARY KEY constraints enforces clustered indexing where as UNIQUE KEY constrains are nonclustered indexes.

1 User has rated as useful.
Login to rate this answer.
Primay Key Unique key
----------- ------------------
There is only one there may be more than 1
Primary key for Unique Key in table
1 table
It can not contain It Can contain Null Value
Null value
Primary key unique key creates non clustered index
creates clustered
index
Login to rate this answer.
Unique key means we have to enter unique value but we can enter null.
But in case of Primary key we should have to enter Unique + Not Null value in that particular column.
Login to rate this answer.