SET IDENTITY_INSERT [表] ON
Update 表 set 自动编号=max(自动编号)+1 Where......
SET IDENTITY_INSERT [表] OFF

解决方案 »

  1.   

    一樓的,你試試看,行嗎?create table a(id int identity(1,1),item varchar (10))
    insert into a values('a')
    insert into a values('b')
    insert into a values('c')select * from aSET IDENTITY_INSERT [a] ON
    update a set id=(select max(id)+1 from a) where id=2
    SET IDENTITY_INSERT [a] off--drop table aServer: Msg 8102, Level 16, State 1, Line 2
    Cannot update identity column 'id'.
      

  2.   

    可以用
    select * into #a from TB 
    WHERE 你的条件
    delete tb from tb a,#a b where a.自动编号=b.自动编号
    insert into tb  (除了自动编号以后的所有字段)
    select (除了自动编号以后的所有字段) from #a
    drop table #a
      

  3.   

    老五的提示如下: Cannot update identity column 
      

  4.   

    [id] [int] IDENTITY (1, 1) NOT NULL 
    这种建表格式是改不了的