Jump to content


Photo

resetting auto-increment field


  • Please log in to reply
2 replies to this topic

#1 gray01

gray01
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 08 May 2003 - 07:27 AM

I\'ve got a few tables with auto-increment IDs. I want to delete all data and start again with empty tables. However, the auto-increment value is remembered, so the empty table isnt populated starting with ID = 1, but with the value before the data was deleted - is there a way to reset it?

#2 pallevillesen

pallevillesen
  • Members
  • PipPipPip
  • Advanced Member
  • 135 posts
  • LocationDenmark

Posted 08 May 2003 - 08:43 AM

ALTER TABLE tbl_name AUTO_INCREMENT = 1;

P.
Palle Villesen, www.birc.dk [br]Bioinformatics Research Center

#3 gray01

gray01
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 08 May 2003 - 02:09 PM

thanks biopv - i hope you get paid for technical support :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users