Jump to content

how do I reset the index (usernumber) that is autoincrement


Recommended Posts

I am in the process of automating users profiles so they can log in and change their CAR information.

 

Since I am in the test phase I put random info in and everything works fine. My problem is that when I delete a record ( up to 17 so far from testing ) The autoincremented number keeps going from 17 to 18 and so on. How do I reset the indexes so it starts at 1 again?

 

Thanks

Hi,

 

Maybe eastcoastdubs also needs to know how to make use of the blanked out record IDs.

 

Say for instance, if there is a table with 10 record rows and indexed between 1 to 10 . Then the whole record on index 5 row is deleted by DELETE FROM table_name WHERE id=\'5\'. Thus leaving the index 5 unused....

 

How to reuse this index 5? Anyone ?

 

MannX.. :roll:

  • 2 weeks later...

Why would you want to reuse a deleted key? Your request can not be done. There is no reason to delete a key and re create it. When you create an auto increment table it\'s use 99% of the time it\'s used as an easy way to do DELETE and UPDATE, SORT BY, (ASC, DESC) etc. SQL statements. Try to re think if you you really need to do these things. I\'ll bet not :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.