Translate

Wednesday, May 27, 2015

How to Reset auto increment after deleting a table row





To delete data and reset the auto increment field using MYSQL, we have a function called TRUNCATE which will help you to accomplish this task.


Syntax:

   

     TRUNCATE  `articles`;

 
Basically , After the function "TRUNCATE" you have to write your table name , in this case is the table called " ARTICLES" .When you run this SQL sentence you will delete the whole data and the auto increment field will be reset.

No comments:

Post a Comment