再说清楚点
SQLSERVER中能不能设置让数据让我们每次删除一条记录后,让它自动按顺序排列,,列如:有0,1,2,3,……数据
我删除中间2数据,,然后它自己自动排成0,1,2……救命!~或者用程序怎么实现,万分感激~!

解决方案 »

  1.   

    update Atable
    set id=id-1
    where id>删除的id
      

  2.   

    update yourtable set id=id-1 where id > 2
      

  3.   

    在SQL中设置位int型吧,在识别一栏中打个勾就ok拉
      

  4.   

    update Atable
    set id=id-1
    where id>删除的id 
      

  5.   

    文本型的没有关系,如果你的文本里面存的是整型Sql server也能自动识别以下写法delete from table1 where id=2
    update table1
    set id=id -1
    where id>'2'不放心的话,写成以下
    delete from table1 where id='2'
    update table1
    set id=cast((cast(id as int)-1 ) as varchar(10))
    where id>'2'
      

  6.   

    同意楼上,我认为这样做没什么意义,难道INT类型的数据不够你用的?