Home Forums SQL Server 2008 SQL Server 2008 - General Cursor taking long RE: Cursor taking long
Lynn Pettis
SSC Guru
Points: 442467
More actions
March 14, 2014 at 12:44 pm
#1697257
Something like this:
with basedata as (
select
*, rn = row_number() over (order by part_no)
from dbo.voters
)
update basedata set
rec_num = rn;
Edit: Removed extra order by in CTE