alter table Tab add id1 int identitydelete from Tab A where exists(select 1 from Tab where id1<A.id1 and id=A.id)alter table Tab drop column id1