表结构and数据 test
id int identity(1.1) name
1 Lucy
2 Meory我先delete from test
然后
insert into test ('Name')结果数据是
3 name怎么才能让id列从1开始。或者说上一跳是1,那下一条应该是2.不管有没有删除
id int identity(1.1) name
1 Lucy
2 Meory我先delete from test
然后
insert into test ('Name')结果数据是
3 name怎么才能让id列从1开始。或者说上一跳是1,那下一条应该是2.不管有没有删除
建议,自己进行编写程序进行逻辑上的判断,并直接插入符合需求的值.
比如:Create table test(id int,name varchar(10))
GO
insert into test ()
select max(id),'Name' from test
GO
DBCC CHECKIDENT ('tb', RESEED)