create new primary key?

  • Thread starter Thread starter Jimmy
  • Start date Start date
J

Jimmy

if i have a table where the first column is the autoincrementing ID field,
and i delete this whole column, is there a way to insert a new ID column and
make it an autoincrementing ID field? if so, can i make it cycle through all
records and increment itself?
 
Yes you can. Assuming that it's an autonumber field, delete the column in
design view. Say Yes to getting rid of the primary key. Save the change.
Compact and repair the database just to be sure. Open the database then
insert a new column where you want it in the design of the table. Make the
datatype Autonumber and set it as the primary key.

Then the question becomes "Why?" You basically have what you had before.
Also, and this might by your answer to Why, an autonumber is not garenteed to
be anything but unique if it is also a primary key. It could insert any
number in any order that it wants.

If you want to order your records in a certain way and control incrementing
new records, an Autonumber is not the answer.
 
If you were to add a new AutoNumber field to your table, it would
automatically be populated with incrementing IDs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top