update xuanzeti set 题号=@i_column from xuanzeti 
         where 题号=@i_column+1
------------------------------
        update xuanzeti set 题号=@i_column
         where 题号=@i_column+1

解决方案 »

  1.   

    try:create trigger xuanzeti_delete on xuanzeti for delete 
    as 
    update t1
    set 题号 = t2.新题号
    from xuanzeti t1,
    (select 题号,新题号  = (select count(1) from xuanzeti where 题号 <= t2.题号) from xuanzeti t2) 
    where t1.题号 = t2.题号
      

  2.   

    set @i=@i_sum-@i_column +1 是空啊
    这个TriggerS不会起作用呀
      

  3.   

    select 题号 as i_column from deleted
    select count(*) as i_sum from xuanzeti
    set @i=@i_sum-@i_column +1i_column是个记录值,i_sum是个统计值,这个怎么能进行运算阿?