declare @id intselect @id=case when not exists (select * from tablename where id=1)
then 1
else
(select min(id)+1 from tablename a where not exists(select * from tablename where id=a.id+1))
endset identity_insert tablename oninsert into tablename (id,column1,column2) values(@id, ,)
set identity_insert tablename off
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货