Jump to content

Archived

This topic is now archived and is closed to further replies.

eastcoastdubs

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

Share this post


Link to post
Share on other sites
delete from table_name
wipes out all data and resets increment.

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

k, i\'ve wanted to know how to do this for quite some time now.

I\'m gonna jump in here, hope someone can help us out.

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

×

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.