1、
Select identity(int,1,1) id,* into #tem from table1 select * from #tem drop table #tem
select rowid=identity(int,1,1),userip into tempT from useraccessselect * from tempT
drop table tempT
不是好方法,尤其是含有union all时,无法使用。