I am making some paging, and I need to make some query and get the result form defined slicing . for example: I need to get all \"top\" rows in range 20n < x < 40n et
From SQL Server 2012 you can use a native pagination in order to have semplicity and best performance:
https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver15#using-offset-and-fetch-to-limit-the-rows-returned
Your query become:
SELECT * FROM Reflow
WHERE ReflowProcessID = somenumber
ORDER BY ID DESC;
OFFSET 20 ROWS
FETCH NEXT 20 ROWS ONLY;