...
select concat drop table ,table name, from TABLES where table schema 數據庫名稱 select concat truncate ,table name, from TABLES where table schema 數據庫名稱 ...
2017-08-07 08:49 0 1578 推薦指數:
...
,你需要再運行一次這個結果集就可以刪除所有的表而不刪除數據庫了 例如: ①新建查詢: ...
1、最簡單的方法,最方便的方法:刪除數據庫,然后重新建立一個空數據庫2、但是有刪除所有表的方法(1)產生刪除表的sql語句,(2)執行sql語句產生刪除表的sql語句:select concat("DROP TABLE IF EXISTS ", table_name, ";") from ...
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; 該條語句執行之后會將數據庫 ...
select 'truncate table ' + Name + ';' from sysobjects where xtype='U' order by name asc; 該條語句執行之后會將數據庫中所有的表都查詢出來,復制出來之后執行truncate語句即可 sysobjects ...
1、先禁用數據庫中所有的約束 select 'alter table ' || table_name || ' disable constraint ' ||constraint_name || ';'from user_constraintswhere constraint_type = 'R ...
如下: 一、RUNCATE TABLE name : 刪除表中的所有行,而不記錄單個行刪除操作。 ...