Let\'s say I have a Turtle table. When I run
SELECT * FROM Turtle ORDER BY Sort
I get this:
Id | Name | Sort 2 Leo 1 3
You can do the update just using a CTE with the row_number(), and then just update the CTE:
;with CTE as ( select *, row_number () over (order by Sort) as RN from Turtle ) update CTE set Sort = RN