set rowcount 99999995delete from Tableset rowcount 0
晕...用DELETE 在MSSQL估计不太可能能删完吧。
select 5条数据 into #临时表 from 1亿条数据的牛X表truncate table 1亿条数据的牛X表 --让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表
delete from not in 这种删除方式会死人的;^_^
可以使用如下的语句: delete from Table where Column not in (select column from Table where Condition ) 先找出其中的五条记录,然后使用Delete命令删去五条之外的记录。
trancate 再逐条 insert
1、 select * into #test from table_Pqs where ...(5条记录) 2、 truncate table table_Pqs 3、 Insert Into table_Pqs select * from #test 4、 Drop table #test
1、 select * into #test from table_Pqs where ...(5条记录) 2、 truncate table table_Pqs 3、 Insert Into table_Pqs select * from #test 4、 Drop table #test 同意这个观点,使用truncate,如果用delete的话,一个是慢,还有一个好像他会写入日志, 然后让数据库日志文件增大。 反正用delete是不好的。
select 5条数据 into #t from 1亿条数据的表truncate table 1亿条数据的表insert 1亿条数据的表 select * from #tdrop table #t
select 5条数据 into #临时表 from 1亿条数据的牛X表truncate table 1亿条数据的牛X表 --让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表顶这个
--让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表
delete from Table where Column not in (select column from Table where Condition )
先找出其中的五条记录,然后使用Delete命令删去五条之外的记录。
2、 truncate table table_Pqs
3、 Insert Into table_Pqs select * from #test
4、 Drop table #test
2、 truncate table table_Pqs
3、 Insert Into table_Pqs select * from #test
4、 Drop table #test
同意这个观点,使用truncate,如果用delete的话,一个是慢,还有一个好像他会写入日志,
然后让数据库日志文件增大。
反正用delete是不好的。
select * from #tdrop table #t
--让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表顶这个
支持【mig1975】的方案(当然其他很多人也是这个方案),干掉牛X表!偶也,偶也,偶也!
select 5条数据 into #临时表 from 1亿条数据的牛X表truncate table 1亿条数据的牛X表
--让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表
-------------------------
支持~
--让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表
KK: []
DJ: []
vt.
1. 切去(树木等)的头端,把...截短
2. 缩短(文章等)
3. 【晶】(截去棱角)使成平面
a.
1. 截头的,去尾的,截短的
2. 缩短了的,被删节的
3. 【晶】截面的
方法不错,跟我想的一样,呵呵
方法不错,跟我想的一样
牛X表!!!up小问题:找出那5条记录会花费多长时间啊?????
drop 牛X表
select top 5 * into 牛X表 from #爽b表
drop #爽b表
--让它牛X,不到10毫秒干掉它。insert 1亿条数据的牛X表 select * from #临时表drop table #临时表
继续顶