Skip to content

Instantly share code, notes, and snippets.

View prathik's full-sized avatar

Prathik Rajendran M prathik

View GitHub Profile
@prathik
prathik / truncate_tables.sql
Last active February 18, 2019 11:20
Mysql Query to generate TRUNCATE TABLE command for all tables in given databases
SELECT
GROUP_Concat(CONCAT('TRUNCATE TABLE ',
table_schema,
'.',
TABLE_NAME) SEPARATOR '; ' )
FROM
INFORMATION_SCHEMA.TABLES
where
table_schema in (
'db1', 'db2'