create trigger on yourTable
For Delete
As
update yourTable set col2 = col2-1
where col1 > (select col1 from deleted)or:
create trigger on yourTable
For Delete
As
declare @a varchar
select @a = col1 from deleted
update yourTable set col2 = col2-1
where col1 > @a
For Delete
As
update yourTable set col2 = col2-1
where col1 > (select col1 from deleted)or:
create trigger on yourTable
For Delete
As
declare @a varchar
select @a = col1 from deleted
update yourTable set col2 = col2-1
where col1 > @a
as
update test set col2=col2-1 where col2>(select col2 from deleted)
表的删除触发器中加:update 表 set col2=(select count(*) from 表 bb where bb.col2<表.col2)+1
FOR delete
AS
begin transaction
declare @pos int
select @pos=col2 from deleted
update yourtable set col2=col2-1 where col2>@pos
commit transaction
-------------------------接分
For Delete
As
update yourTable set col2 = col2-1
where col1 > (select col1 from deleted)
For Delete
As
update 你的表 set col2 = col2-1
where col1 > (select min(col1) from deleted)