Update operations in SQL Server occur in clustered index order?
I want to set the sequential position in a table, but SQL Server don't let me use ORDER BY
in an update operation.
I tested and the updates occur in the clustered index which is the position column, so everything is fine, but can I trust it will always work like that?
DECLARE @Position BIGINT = 0
UPDATE
Paginations
SET
@Position = Position = @Position + 1