Select row_number() OVER (ORDER BY PID ASC) AS RowID, * FROM TEST
怎么把行号插入新建的列中? 直接UPDATE函数不支持!
------最佳解决方案--------------------
Select row_number() OVER (ORDER BY PID ASC) AS RowID, * into #t
FROM TEST
go
update test
set id=RowID
from test inner join #t on test.列名=#t.列名