没有其他简单的办法,只好编程解决。
可以使用存储过程,也可以使用触发器。
如:
select * into #t from yourtable
truncate table yourtable
insert yourtable select * from #t

解决方案 »

  1.   

    对于identity字段的整理要这样select 除id字段 into #ttruncate table 表insert into 表 (除id字段) select * from #t
      

  2.   

    select * into #t from yourtable
    go
    alter table #t
    drop column id
    go
    truncate table yourtable
    go
    insert yourtable select * from #t
    go
      

  3.   

    真的吗?说说,学学,IDENTITY字段如何实现
      

  4.   

    identity字段,就是标识字段,设计表时,标识选择"是".不过这样是有跳号的
      

  5.   

    identity 字段可以递增一个步长(可以设置),但是删除纪录,identity 不会改变,会出现跳号