select sn=(select sum(1) from tablename where id<=a.id),* from tablename aor
alter table tablename drop column id
go
alter table tablename add id int identity(1,1)
alter table tablename drop column id
go
alter table tablename add id int identity(1,1)
再做上面的语句!alter table tablename add id int identity(1,1)