如何在不删除表中记录的情况下重置identity列?

来源:互联网 发布:b2b网站群发软件 编辑:程序博客网 时间:2024/04/28 03:40
只有先删除,然后将结果集存在临时表。然后初始化表,再将临时表中的数据插入表中

delete 表 where id in(3,4)

select * into #temp from 表

truncate table 表

insert into 表 select 姓名 from #temp