Dropping Unnamed Primary Constraint

Database
Fan

Dropping Unnamed Primary Constraint

Hi,
I tried executing this script in the database It was working fine

CREATE TABLE T04 (C01 INT NOT NULL, PRIMARY KEY(C01));

Unnamed Primary Key Constraint has been created and now i am trying to drop that constraint
can any one suggest me how to drop this unnamed PK constraint??

Thanks,
Teju
3 REPLIES
Junior Contributor

Re: Dropping Unnamed Primary Constraint

Hi Teju,
dropping an unnamed constraint is just using the same as adding it:
ALTER TABLE DROP PRIMARY KEY(C01)

But in your case this will not work, because it has been implemented as UPI on that table (SHOW the table) and you can't drop a PI.

Dieter
Fan

Re: Dropping Unnamed Primary Constraint

Thanx....

Re: Dropping Unnamed Primary Constraint

hi

how about dropping a named primary key constraint?

thnx in advance