Sql Server临时表中插入标示列

select 
ROW_NUMBER() over( order by sort_id asc) as rows,* 
into #tmp_tb
from tb_district

其中sort_id为您原表的排序列。

tb_district为要操作的表。

转载于:https://www.cnblogs.com/daretodream/archive/2013/04/03/2997800.html

猜你喜欢

转载自blog.csdn.net/weixin_33878457/article/details/94101622