最好不要这样做,确实要改的话可以这样:
  在删除3的同时做个更新:
  update 表 set 字段=字段-1 where 字段>删除字段的值(这儿是3)
做个删除的触发器也可以,这样在数据库中删除也可以执行。

解决方案 »

  1.   

    1.
    create table table1
    (
    userid int identity(1,1) not null,
    username varchar(30)
    )insert into table1(username) values('tom1')
    insert into table1(username) values('tom2')
    insert into table1(username) values('tom3')select * from table12.
    alter table table1
    drop column useridselect * from table1
    3.
    alter table table1
    add
    userid int identity(1,1) not nullselect * from table1
      

  2.   

    谢谢各位的意见,我却是需要这么做,我想知道那种方法的效率比较高?
    是用 lincanwen(海) 的update字段的方法好呢?
    还是 wzg2000(王) 的来回倒表的方法好??
    再请教。