在查询中:select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表 select * from #temp或:select (select sum(1) from 表 where id<=tem.id) 行编号,* from 表 tem
同意 create table (a int identity)
要是4号空着,那你下会insert的时候就用4号不就行了。 是不是做会计凭证啊^_^
select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表名 alter table #temp drop column 序号列 EXEC sp_rename '#temp.[ID_Num]', '#temp', '序列号' delete * from 表名 insert into 表名 select * from #temp不过我的意见和大力一样,没有必要那么麻烦!
select * from #temp或:select (select sum(1) from 表 where id<=tem.id) 行编号,* from 表 tem
create table (a int identity)
是不是做会计凭证啊^_^
alter table #temp drop column 序号列
EXEC sp_rename '#temp.[ID_Num]', '#temp', '序列号'
delete * from 表名
insert into 表名 select * from #temp不过我的意见和大力一样,没有必要那么麻烦!