delete tablename where id=2
alter table tablename
drop column id
go
alte table tablename
add id int identity(1,1)
go
变为4就不用删除id字段,再insert后,id就变为4就可以了
alter table tablename
drop column id
go
alte table tablename
add id int identity(1,1)
go
变为4就不用删除id字段,再insert后,id就变为4就可以了
------------当你的ID没有设置为"自动增长列时",你想insert什么都可以的.如果我不做删除直接按增加,让ID就变4
------------将ID列设置为:自动增长列时,它就可以完成你想要的功能