简体   繁体   中英

Unable to truncate multiple table at a time

I am trying to truncate 3 tables using their table names out of 5 tables. Is there any syntax for it as am unable to find

Can anyone give me reference?

to truncate multiple table

SELECT concat('TRUNCATE TABLE ', TABLE_NAME, ';')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME in ('table1','table2','table3')

or run it one by one

truncate table table1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM