flusing the database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    #1

    flusing the database

    hii guys,
    I am using a table .which i use it for testing for some times .when it goes live i must flush all the data from it so that the Id counter starts from 1.How to do it.....now i drop the table and then create the table again.any other better method.


    thanks,
    pradeep
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You can reset the auto increment value for a table using
    [CODE=mysql]alter table tableName auto_increment = 1 [/CODE]

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      You can use the TRUNCATE syntax.

      It basically drops and re-creates the table, which also resets the Auto_Increment value.

      Comment

      Working...