SQL清空全部表数据

SQL清空全部表数据

  1. 先执行select语句生成所有truncate语句
    语句格式:
select CONCAT(‘truncate TABLE ‘,table_schema,‘.‘,TABLE_NAME, ‘;‘) from INFORMATION_SCHEMA.TABLES where? table_schema in (‘数据库1‘,‘数据库2‘);

示例:

select CONCAT(‘truncate TABLE ‘,table_schema,‘.‘,TABLE_NAME, ‘;‘) from INFORMATION_SCHEMA.TABLES where  table_schema in (‘test‘);

相关链接:
https://blog.csdn.net/iw1210/article/details/79586033
https://www.cnblogs.com/kevingrace/p/9439025.html

SQL清空全部表数据

上一篇:C# 文件夹操作


下一篇:(C#).NET 2.0 ~ 4.0 OS requirements.