Subject | Re: [IBO] Beginner needs help |
---|---|
Author | Lucas Franzen |
Post date | 2001-01-24T15:07:33Z |
jasonparkersmith@... schrieb:
"easiest" and safest way.
Maybe you have success with:
1. alter table <t> add <newpkfield> <datatype> NOT NULL;
2. UPDATE TABLE <t> SET <newpkfield> = <oldpkfield>;
3. alter table <t> drop <oldpkfield>;
4. alter table <t> add constraint <constraint_name> primary key
(newpkfield);
But I would prefer dropping the table ...
Regards
Luc.
>Drop the table (and its dependencies) and recreate it - that's the
> Hi there
>
> I have set up a table and I need to rename a field which is a primary
> key.
>
> How do I do it?
>
> Thanx
"easiest" and safest way.
Maybe you have success with:
1. alter table <t> add <newpkfield> <datatype> NOT NULL;
2. UPDATE TABLE <t> SET <newpkfield> = <oldpkfield>;
3. alter table <t> drop <oldpkfield>;
4. alter table <t> add constraint <constraint_name> primary key
(newpkfield);
But I would prefer dropping the table ...
Regards
Luc.