有一表,如下:
编号 名字 性别
25 张三 男
12 李四 女
19 王五 男
怎么样能够批量重新生成编号,以00001,000002开始
------解决方案--------------------
- SQL code
alter table tb alter column [编号] varchar(8)declare @i int select @i=0update tb set id=right([email protected],5),@i+=1
alter table tb alter column [编号] varchar(8)declare @i int select @i=0update tb set id=right([email protected],5),@i+=1