Subject Re: [firebird-support] Droppping UNIQUE constraint
Author Milan Babuskov
PenWin wrote:
> Yet another question. Some time ago I set a table column to be unique:
>
> ALTER TABLE tablename ADD UNIQUE(column)
>
> Now I discover that I in fact can't have this column unique. How do I drop
> the constraint?

If you want to do something like that, you better name your constraints:

ALTER TABLE tablename ADD CONSTRAINT constr_name UNIQUE(column);

ALTER TABLE tablename DROP CONSTRAINT constr_name;

If you don't, Firebird will give it an automatic name, and only way to
find out which is it is to query the system tables. Most of the
administration tools do it for you, so I suggest you use one. (for
example, FlameRobin always asks you for constraint name when creating
new constrains, so it's easier to drop them later).

--
Milan Babuskov
http://www.flamerobin.org