This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / SQL Server - Empty Tables? I want to empty all the records in the tables of a SQL SERVER database, what's the best way to do it? Thanks.
-ttaaoo(tao);
2005-3-6
(#2161384@0)
-
isn't it "DELETE FROM table_name"?
-canadiantire(轮胎-M.I.N.K.);
2005-3-6
(#2161389@0)
-
There are so many tables so I hope there is a better way to do it instead of deleting tables one by one. In addition, even truncating table is better than deleting table since I want the ID column is re-set to 1.
-ttaaoo(tao);
2005-3-6
(#2161437@0)
-
delete all tables and create them
-expertune(伪劣);
2005-3-6
(#2161447@0)
-
I want to know whether there is a SQL Command statement to empty database records but keep table structure.
-ttaaoo(tao);
2005-3-6
(#2161451@0)
-
The simple way is: truncate table [table name]
-itengcon(itengcon);
2005-3-6
(#2161931@0)
-
sp_MsForEachTable 'Truncate table ?' // will truncate all of tables in one database keeping the table structure.
-yangn(Raymond);
2005-3-7
(#2163571@0)
-
1. select 'delete from ' + name from sysobjects where type='u'
2. 把1的结果再run一遍
-zxcvb(朝天椒);
2005-3-7
(#2163586@0)