create table tb(id int, ident int identity(10000, 1))
insert into tb
select 1000 union all
select 1001 union all
select 1002 union all
select 1003
DBCC CHECKIDENT('tb', RESEED, 20000) (设置当前的id为20000,下一条插入的记录值为20001)
insert into tb
select 1004 union all
select 1005 union all
select 1006 union all
select 1007
select * from tb
insert into tb
select 1000 union all
select 1001 union all
select 1002 union all
select 1003
DBCC CHECKIDENT('tb', RESEED, 20000) (设置当前的id为20000,下一条插入的记录值为20001)
insert into tb
select 1004 union all
select 1005 union all
select 1006 union all
select 1007
select * from tb
drop table tb
原文地址 http://bbs.youkuaiyun.com/topics/110035598