psubbiah93@gmail.com

Saturday, 21 November 2015

Truncate All tables in mysql


Truncate all tables in mysql using one comment


SELECT CONCAT('truncate table ',table_name,';')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'table_name'
AND TABLE_TYPE = 'BASE TABLE';

Execute the above comment it shows the truncate comment like below

truncate table table1;
truncate table table2;
truncate table table3;
truncate table table4;
truncate table table5;

Copy the Comment & paste to the SQL editor and run the comment....

Unknown Web Developer

Hello! I am Subbiah P and this is my web technologies blog. My specialities are PHP, Asp.net, jQuery, and CMS web application development. I do accept paid work. Write to me to start working on your dream project . I am Working as Web developer in Peace Soft Technologies

No comments:

Post a Comment