Link to home
Start Free TrialLog in
Avatar of yeewee64
yeewee64

asked on

SQLCE Drop Unique Index

Hi,

I created a unique index in SQLCE using "CREATE UNIQUE INDEX "idxABC" ON "ABC"". Now I want to drop this index, may I know how do I do that?

I tried "DROP INDEX "ABC.idxABC"", doesn't work. The document says it won't work on PRIMARY KEY or UNIQUE INDEX anyway.

I tried "ALTER TABLE "ABC" DROP CONSTRAINT "idxABC"", doesn't work too.

What should I do? Thanks in advance!
Avatar of Mikal613
Mikal613
Flag of United States of America image

try

ALTER TABLE 'ABC' DROP CONSTRAINT 'idxABC'

or

ALTER TABLE ABC DROP CONSTRAINT idxABC
Avatar of yeewee64
yeewee64

ASKER

Hi Mikal613,

Thanks for the response. I've found the answer already. It's just "DROP INDEX ABC.idxABC", without the single or double quotes around the index name :S.

And I think the document was referring to PRIMARY KEY or UNIQUE constraint made to table or column that requires ALTER TABLE DROP CONSTRAINT.


ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Mikal613,

I tried "ALTER TABLE ABC DROP CONSTRAINT idxABC", it didn't work. I think that's because I used "CREATE INDEX" to create it.

So far, only "DROP INDEX" works for me. So I don't think I can set your comment as the answer to this question. Do you mind if I close this question and get a refund? I mean, as far as I know, experts-exchange only give me two options, to give all 195 points or 0 point to you. I wish I could give half the points to you for attempting to answer my question, and your answer was pretty close too.

post this in commnity support