hello guys how r u ?
my question is that, can we keep more then one primary key in a single table in sql server2005? if yes then kindly tell me how ? and if no then kindly tell me the reason?
Reply Soon
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Oct 28, 2011, 3:24 PM
But Faisal, you can create Identity Key column also.
http://www.c-sharpcorner.com/Forums/Thread/125873/sql-server-fun-4-how-to-insert-duplicate-values-to-iden.aspx
Sam HobbsPosted Oct 28, 2011, 1:41 PM
TulasiPosted Oct 28, 2011, 7:53 AM
Primary Key: We cannot create multiple primary key on single table. Primary Key enforces uniqueness of the column on which they are defined. Primary Key creates a clustered index on the column. Primary Key does not allow Nulls. When you define more than one column as your primary key on a table, it is called a composite primary key.
Note : we can create only one Clustered Index on table
have a look at this http://weblogs.sqlteam.com/jeffs/archive/2007/08/23/composite_primary_keys.aspx
Please mark the answer as Accepted if it helps you.
Faisal AnsariPosted Oct 29, 2011, 1:58 AM
Thanks 4 reply