SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard mcsolas's Avatar
    Join Date
    Jul 2004
    Location
    Hermosa Costa Rica
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Restarting the autonumber fields in access

    I have been testing on a database and running a bunch of bulk imports - deleting them, retuning it and then .. repeat. Well I am getting the auto number field higher and higher, but there is no records in there. Is there any way to restart the numbering. I know how to rename, change the key, delete the old one and then name the new one the same. What fun but is there a better way. I came across this:

    DROP INDEX ConsumerID ON Consumer;

    Executed it but nothing happens, at least it doesn't reset that field back to 1.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    delete the rows from the table, compact the database, and voila
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard mcsolas's Avatar
    Join Date
    Jul 2004
    Location
    Hermosa Costa Rica
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was getting record 200 to 1500 .. skips not important but you know, now its cleaner. Thats what I like to see. Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •