hello all

i have allready created table and wan to add Composite primary key into that so for that i am using following statement

ALTER TABLE pqrimasterdetail ADD  primary key  (PQRIMasterID,Type,Year,PhysiciansID);

but in not executed successful it gives

the query could not be Executed.
Multiple Primary key Defined


if any one have idea then Please Help asap Thank's in advance

Recommended Answers

All 2 Replies

Well, if you have defined already a primary key, you cannot have another one. What does show create table pqrimasterdetail say?
You can instead add a second unique key: ALTER TABLE pqrimasterdetail ADD [B]Unique[/B] (PQRIMasterID,Type,YEAR,PhysiciansID);

thank you for your reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.