Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i create one table with two primary key fields in SQL2005, whn i proposed to build the table a error is occured, is there any posiblity for two primary key in a table?
Posted
Comments
thasfi 10-Feb-11 9:57am    
thank u, now im very clear, thnx for clearing my doubts

No.

A table must have one, and only one, primary key.

You can have as many secondary keys as you need, but only the single primary.
 
Share this answer
 
You can only have one Primary Key. If you want to use two different columns, you can have a look at Composite/Compound Key[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900