SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    Calif.
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can I reset the auto_increment field?

    I created a table with an auto_increment field and made some test posts. Now I deleted those posts and I want to reset it so the first post is 1 again. How is this done?

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If everything is removed from the table, the auto_increment field resets automatically I belive..
    - website

  3. #3
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and by reading the manual I found this
    ALTER TABLE tbl_name AUTO_INCREMENT = 100
    will start your records at 100

    ALTER TABLE tbl_name AUTO_INCREMENT = 1000
    will start your records at 1000
    - website


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •