try:
ALTER TABLE table1 ADD temp_id INT IDENTITYSET IDENTITY_INSERT table1 ONupdate table1 set temp_id=字段1insert into table1 select * from table1 where 序号=1 or 序号=2SET IDENTITY_INSERT table1 OFFALTER TABLE table1 DROP COLUMN 字段1 exec sp_rename 'table1.[temp_id]','字段1','column'
ALTER TABLE table1 ADD temp_id INT IDENTITYSET IDENTITY_INSERT table1 ONupdate table1 set temp_id=字段1insert into table1 select * from table1 where 序号=1 or 序号=2SET IDENTITY_INSERT table1 OFFALTER TABLE table1 DROP COLUMN 字段1 exec sp_rename 'table1.[temp_id]','字段1','column'
ALTER TABLE 表 ADD 编号1 bigint identity(100005,1) not nullSET IDENTITY_INSERT table1 ONupdate table1 set temp_id=字段1insert into table1 select * from table1 where 序号=1 or 序号=2SET IDENTITY_INSERT table1 OFFALTER TABLE table1 DROP COLUMN 字段1 exec sp_rename 'table1.[temp_id]','字段1','column'
insert 表 select 字段1+1,字段2 from 表
这种方法比较麻烦