Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    16

    reset primary key

    Is there a way to reset the primary key back to starting with 1, of course i would delete all existing recordset. I can do it by deleting the key and re-keying, but there seems liek there should be a way.



    Thanks

  2. #2
    StepUP is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Dec 2005
    Posts
    99
    Well the quick and dirty way to do that is to go into the design of the table and delete the key field (I'm assuming its an "auto number" field), save it, then add the field back in.

    However, it you have relationships with other tables with a foreign key relating to the primary, you should rename the primary key field and change its type to Long Integer, create a new auto number field with the original primary field name, and then you would have to create an update query that updates the foreign key with the new field. If you have a relationship defined with referential integrity, would have to delete that first before going through this process and then reestablish it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-12-2009, 09:55 AM
  2. database structure:primary key debate
    By MUKUDU99 in forum Database Design
    Replies: 0
    Last Post: 08-19-2008, 12:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums