select concat('drop table ',table_name,';') from TABLES where table_schema='数据库名称';
select concat('truncate ',table_name,';') from TABLES where table_schema='数据库名称';
select concat('drop table ',table_name,';') from TABLES where table_schema='数据库名称';
select concat('truncate ',table_name,';') from TABLES where table_schema='数据库名称';
本文介绍基于Microsoft SQL Server软件,实现数据库表的创建、修改、复制、删除与表数据处理的方法~
mydb换成你想删除的数据库的名字这样可以生成一个批量处理的sql语句,你需要再运行一次这个结果集就可以删除所有的表而不删除数据库了
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M