abyssal Posted April 6, 2012 Share Posted April 6, 2012 Hi, I have a table with a column that has auto increment. I deleted the table's content but when I add new data it starts from 23. How can I reset it back to 0 ? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 try TRUNCATE (tablename) Quote Link to comment Share on other sites More sharing options...
abyssal Posted April 6, 2012 Author Share Posted April 6, 2012 Thanks man ! Really appreciate. Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 no worries Quote Link to comment Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 Be sure you don't want any data in the specified table as TRUNCATE will remove all the data... It's not a simple function to reset the auto-increment value to 0. Quote Link to comment Share on other sites More sharing options...
abyssal Posted April 6, 2012 Author Share Posted April 6, 2012 Be sure you don't want any data in the specified table as TRUNCATE will remove all the data... It's not a simple function to reset the auto-increment value to 0. Yep, I'm building a php/sql app and my table was only for testing, so no important data lost . Thanks ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.