/*
SQL2000快速批量删除前N条数据
--前提:只能根据拥有聚集索引的id才能达到准确无误的删除操作
--下面是一个简单的例子
--废话不多说,看代码
*/
if object_id('tb') is not null drop table tb
go
create table tb (id int)
go
insert tb select 2
union all select 1
union all select 3
go
create index idx1 on tb(id)
go
set rowcount 2
delete a from tb a with(index = idx1)
set rowcount 0
go
select * from tb
go
drop table tb
go