create table tb (id int) insert tb select 1 union all select 2 union all select 3 set rowcount 1 --将1改为你的n delete from tb set rowcount 0 select * from tb drop table tb
select identity(int,1,1) as id ,* into tmp from tablename drop table tmp where id <=n ---- 請問怎樣刪除某數據表的前n條記錄. sp_rename 'tmp','tablename'
---如果没有序号列! select identity(int,1,1) as id ,* into tmp from tablename drop table tmp where id <=n ---- 請問怎樣刪除某數據表的前n條記錄. drop table tablename sp_rename 'tmp','tablename'