Inserting a new PK into an existing table
- From: "Jens Lenge" <spampot@xxxxxxx>
- Date: 31 Aug 2006 08:46:45 -0700
Hello world,
I want to add a new numeric column "id" into an existing table that is
intended to be the new primary key. As the table already contains data,
I need to fill the "id" column with distinct values before I can make
it the new primary key.
I have looked for SQL commands to add the new column and fill it with a
series of values like 1, 2, 3, ..., but have not found something like
that. As I am quite new to SQL, I have also read a number of tutorials,
but found no hint on the topic.
Now I am curious how this is "normally" done.
Can it be done with "plain" SQL or do I need extensions like PL/SQL?
Jens
.
- Follow-Ups:
- Re: Inserting a new PK into an existing table
- From: DA Morgan
- Re: Inserting a new PK into an existing table
- From: Mark D Powell
- Re: Inserting a new PK into an existing table
- From: David Newman
- Re: Inserting a new PK into an existing table
- Prev by Date: Re: Copying lakhs of Records in a table of 25 columns from text file or Excel ***.
- Next by Date: Re: Inserting a new PK into an existing table
- Previous by thread: Copying lakhs of Records in a table of 25 columns from text file or Excel ***.
- Next by thread: Re: Inserting a new PK into an existing table
- Index(es):