Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Restart Automatic Primary Key Index

Discussion in 'Information Technology' started by Christopher Lusardi, Jul 28, 2006.

  1. Christopher Lusardi

    Christopher Lusardi
    Expand Collapse
    Guest

    Hello, from the desktop menu, start, Microsoft Access 2003, and opening
    a database, how do I restart the autmatic increment of the primary key?


    If I delete all the rows of a database and leave just the headers, save
    the database, re-enter the database it starts increment the key where
    it left off before and not back at one!

    Thank you,
    Christopher Lusardi
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Delhi dash to restart Sikh riot probe (The Telegraph) Breaking News Oct 26, 2005

  3. jleckrone@hotmail.com

    jleckrone@hotmail.com
    Expand Collapse
    Guest

    Copy your table and only copy the structure, not the stucture and data.
     
  4. Mastercafe - Juan

    Mastercafe - Juan
    Expand Collapse
    Guest

    Try to compact and repair before after you delete the records, always reset
    the autonumbers counters

    --
    Saludos desde Oviedo (Asturias)

    Juan Menéndez
    Mastercafe S.L.
    www.mastercafe.com
    juan@mastercafe.com

    Si la información recibido te ha servido indicalo con otro post.
    En caso de resolverlo por otros medios, indica la solución usada
    ayudaras a otros y aprenderemos todos.

    "Christopher Lusardi" <clusardi2k@aol.com> escribió en el mensaje
    news:1148064232.508522.194860@u72g2000cwu.googlegroups.com...
    > Hello, from the desktop menu, start, Microsoft Access 2003, and opening
    > a database, how do I restart the autmatic increment of the primary key?
    >
    >
    > If I delete all the rows of a database and leave just the headers, save
    > the database, re-enter the database it starts increment the key where
    > it left off before and not back at one!
    >
    > Thank you,
    > Christopher Lusardi
    >
     
  5. Christopher Lusardi

    Christopher Lusardi
    Expand Collapse
    Guest

    jleckrone@hotmail.com wrote:
    > Copy your table and only copy the structure, not the stucture and data.


    I'm lost! Explicitly, how do I do this?

    Christopher Lusardi
     
  6. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Others have told you the mechanical way of accomplishing what you asked.

    I wanted to point out that it shouldn't be necessary.

    An Autonumber field is intended for one purpose only: to provide a
    (practically guaranteed) unique value that can be used as a primary key.
    24634, 24636. 24637 fulls that need just as well as 1, 2, 3 does.

    No meaning should even be assigned to the value of an Autonumber field. In
    fact, it's rare that their value is even presented to the user. Recognize
    that Autonumbers are not guaranteed to be gap-free in numbering and, in
    fact, if you ever have a requirement to replicate your database, the
    Autonumber field will be converted to a random number, not a sequential one.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Christopher Lusardi" <clusardi2k@aol.com> wrote in message
    news:1148064232.508522.194860@u72g2000cwu.googlegroups.com...
    > Hello, from the desktop menu, start, Microsoft Access 2003, and opening
    > a database, how do I restart the autmatic increment of the primary key?
    >
    >
    > If I delete all the rows of a database and leave just the headers, save
    > the database, re-enter the database it starts increment the key where
    > it left off before and not back at one!
    >
    > Thank you,
    > Christopher Lusardi
    >
     
  7. Christopher Lusardi

    Christopher Lusardi
    Expand Collapse
    Guest

    Mastercafe - Juan wrote:
    > Try to compact and repair before after you delete the records, always reset
    > the autonumbers counters
    >


    I'm really lost! Can you be so gracious and explain to me how do I do
    this, taking me step by step to the ultimate conclusion?

    Christopher Lusardi
     
  8. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    I agree in principe
    however I do have several static tables (We'll have a discussion about
    those -when/if I'm ever in your neck of the woods about those)
    where I know the autonumber values & use them
    as already stated though autonumbers are "stupdid"

    Pieter

    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:%23Wwjkd3eGHA.1456@TK2MSFTNGP04.phx.gbl...
    > Others have told you the mechanical way of accomplishing what you asked.
    >
    > I wanted to point out that it shouldn't be necessary.
    >
    > An Autonumber field is intended for one purpose only: to provide a
    > (practically guaranteed) unique value that can be used as a primary key.
    > 24634, 24636. 24637 fulls that need just as well as 1, 2, 3 does.
    >
    > No meaning should even be assigned to the value of an Autonumber field. In
    > fact, it's rare that their value is even presented to the user. Recognize
    > that Autonumbers are not guaranteed to be gap-free in numbering and, in
    > fact, if you ever have a requirement to replicate your database, the
    > Autonumber field will be converted to a random number, not a sequential
    > one.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Christopher Lusardi" <clusardi2k@aol.com> wrote in message
    > news:1148064232.508522.194860@u72g2000cwu.googlegroups.com...
    >> Hello, from the desktop menu, start, Microsoft Access 2003, and opening
    >> a database, how do I restart the autmatic increment of the primary key?
    >>
    >>
    >> If I delete all the rows of a database and leave just the headers, save
    >> the database, re-enter the database it starts increment the key where
    >> it left off before and not back at one!
    >>
    >> Thank you,
    >> Christopher Lusardi
    >>

    >
    >
     
  9. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Christopher,

    After you have deleted the records from your table, and you are back
    looking at your Database Window...
    1. Go to the Tools menu.
    2. Point to Database Utilities.
    3. Select Compact & Repair from the submenu.

    --
    Steve Schapel, Microsoft Access MVP


    Christopher Lusardi wrote:
    > I'm really lost! Can you be so gracious and explain to me how do I do
    > this, taking me step by step to the ultimate conclusion?
     
  10. Jamie Collins

    Jamie Collins
    Expand Collapse
    Guest

    Christopher Lusardi wrote:
    > If I delete all the rows of a database and leave just the headers, save
    > the database, re-enter the database it starts increment the key where
    > it left off before and not back at one!


    See:

    ACC2000: Jet IDENTITY Datatype Seed and Increment Reset to 1
    http://support.microsoft.com/default.aspx?scid=kb;en-us;202117

    Jamie.

    --
     

Share This Page