DBCC CHECKIDENT ( table_name [, { NORESEED | { RESEED [, new_reseed_value ] } } ] ) [ WITH NO_INFOMSGS ]
--重置表的自增字段,保留数据
DBCC CHECKIDENT ('t1',reseed,1)
-- 设置允许显式插入自增列
SET IDENTITY_INSERT t1 ON
-- 当然插入完毕记得要设置不允许显式插入自增列
SET IDENTITY_INSERT t1 Off
--- truncate删除原表数据,并重置自增列
truncate table t1
--显示当前自增列的值
DBCC CHECKIDENT ('t1',noreseed)