日期:2014-05-19  浏览次数:20486 次

sql server 2005 如何设置自动递增字段的初始值?
sql   server   2005   如何设置自动递增字段的初始值?
不想删除原有的数据的情况下,如何设置初始值?

------解决方案--------------------
create table tb(id int identity(1,1), b varchar(10))
insert into tb(b) select 'a '
union all select 'b '
union all select 'c '
DBCC CHECKIDENT (tb, RESEED, 100)
insert into tb(b) select 'a '
union all select 'b '
union all select 'c '
select * from tb
drop table tb
/*
id b
----------- ----------
1 a
2 b
3 c
101 a
102 b
103 c

(6 行受影响)
*/
------解决方案--------------------
mark