8 Years
Discussion Span
Last Post by Piya27

m not really sure but i think candidate key is the column which qualifies to be a primary key.
so u can set this column as primary key if u wish to at a later date.
but i dont think you can assign a candidate key


What I actually want is to make one key of my table as candidate key.
I used keyword UNIQUE also but I was not able to accomplish the task.
Pls suggest.


set Primary key.

But Sir, I don't want to set the key as primary key..

Actually, I am sorry not to tell my problem in detail..

Specifically, I have a table with enrolno as primary key and I want to make classid As Candidate key, because I want to reference ClassID from a foreign key of another table. For that when I use the query to set FOREIGN KEY constraint that refers to the classid of this table,i get the error asking for classid to be either primary or candidate key..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.