有两种方法来实现
1.楼主仅是为了填充由于 DELETE 语句导致的标识值中的空隙,可以利用下面的语句来实现
SET IDENTITY_INSERT 表名 ON
insert into 表名 (id,name) (10,'test')
SET IDENTITY_INSERT 表名 OFF
--此处ID为自增长列名,10为列中缺少的值
Checking identity information: current identity value '14', current column value '14'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.