Subject RE: [firebird-support] Altering Primary Key on Table
Author Alan McDonald
> I need to change the sort order from ascending to descending on the
> Primary Key for an (empty) table.

you just ADD a descending index on the field. Leave the ascending one there.
The sort order is only provded by an ORDER by clause
Alan

> Have tried (Alter Index/ Drop
> Index) using IBExpert (Pers) and EMS Interbase both of which
> generate SQL errors.
> According to the IB 6 Lang Ref:
> Alter Index
> "Alter Index Fails if Index is defined for a UNIQUE, PRIMARY KEY or
> FOREIGN KEY constraint .. to alter such an index, use DROP INDEX to
> delete the index etc."
> Drop Index
> "Important- You cannot drop system-defined indexes, such as those
> for UNIQUE, PRIMARY KEYS and FOREIGN KEYS".
>
> So, how does one do this with an FB (1.5) Table? Must one drop the
> table then re-create from scratch or is there an alternative 'work-
> around'?
>
> Regards,
>