select 'truncate table ' + Name + ';' from sysobjects where xtype='U' order by name asc; 该条语句执行之后会将数据库中所有的表都查询出来,复制出来之后执行truncate语句即可 sysobjects ...
今天又学到一招,可以快速删除数据库中所有的用户表中的数据。我是个菜鸟,望各位大神多多指教 select truncate table Name from sysobjects where xtype U order by name asc 该条语句执行之后会将数据库中所有的表都查询出来,复制出来之后执行truncate语句即可 sysobjects 在数据库内创建的每个对象 约束 默认值 日志 规 ...
2012-02-18 14:41 1 12191 推荐指数:
select 'truncate table ' + Name + ';' from sysobjects where xtype='U' order by name asc; 该条语句执行之后会将数据库中所有的表都查询出来,复制出来之后执行truncate语句即可 sysobjects ...
select 'truncate table ' + Name + ';' from sysobjects where xtype='U' order by name asc; 该条语句执行之后会将数据库中所有的表都查询出来,复制出来之后执行truncate语句即可 sysobjects ...
...
,你需要再运行一次这个结果集就可以删除所有的表而不删除数据库了 例如: ①新建查询: ...
select concat('drop table ',table_name,';') from TABLES where table_schema='数据库名称'; select concat('truncate ',table_name,';') from TABLES where ...
1、先禁用数据库中所有的约束 select 'alter table ' || table_name || ' disable constraint ' ||constraint_name || ';'from user_constraintswhere constraint_type = 'R ...
1、最简单的方法,最方便的方法:删除数据库,然后重新建立一个空数据库2、但是有删除所有表的方法(1)产生删除表的sql语句,(2)执行sql语句产生删除表的sql语句:select concat("DROP TABLE IF EXISTS ", table_name, ";") from ...
如下: 一、RUNCATE TABLE name : 删除表中的所有行,而不记录单个行删除操作。 ...