Subject | Re: Rename Primary Key Foreign Key or Index |
---|---|
Author | Alexander V.Nevsky |
Post date | 2003-10-03T14:14:27Z |
--- In firebird-support@yahoogroups.com, "Celyo" <iliev@c...> wrote:
RDB$RELATION_CONSTRAINTS and you can easy select name of PK for any
table.
each database instance examining it's system tables. To avoid such a
problems wise persons don't rely on system generated names of
constrains and give them self-invented names on creation ;) so in all
instances of database they are the same.
Best regards,
Alexander.
> and I have a Primary Key on Field1.Iliya, this is simple - take a look on structure of the table
>
> I want to change the Primary Key to be on Field3.
>
> The problem is that I don't know the name of the key!!!
RDB$RELATION_CONSTRAINTS and you can easy select name of PK for any
table.
> I know I can see it using either a sql script or any db managementutility
> but my script has to work on databases with PK with different namesand
> should be done ONLY using sql scriptSo you should make a program which generate script from template for
each database instance examining it's system tables. To avoid such a
problems wise persons don't rely on system generated names of
constrains and give them self-invented names on creation ;) so in all
instances of database they are the same.
Best regards,
Alexander.