Jump to content

Auto_Increment


gork4life

Recommended Posts

I need help I'm with a table that primary keys auto-increments let's say we have five records listed with primary key as 1,2,3,4,5. What I want is when I delete lets say record 5, the next time I create a record I want it to be 5. Is this possible and is it recommended?

Link to comment
Share on other sites

I need help I'm with a table that primary keys auto-increments let's say we have five records listed with primary key as 1,2,3,4,5. What I want is when I delete lets say record 5, the next time I create a record I want it to be 5. Is this possible and is it recommended?

 

As an idea, we could have an interesting discussion, but the fact is, that is not supported.

Link to comment
Share on other sites

On death row there is a particularly nasty character guilty of numerous murders. Having been a repeat offender all his life he has rather a large criminal records file, the ID of this file being his social security number. The guy is finally executed so his social security number is no longer required.

 

By coincidence, just after he is executed, your child is born and, as this guy no longer needs his SSN, it is reallocated to  your child. Your child, though completely innocent, now has a criminal record as long as your arm.

 

A fictitious and extreme example but nonetheless a lesson in why you don't reallocate keys.

Link to comment
Share on other sites

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.