WITH Rows
AS (
SELECT ROW_NUMBER() OVER (ORDER BY ProductID)
AS [Row Number],
SalesOrderDetailID AS [Detail ID]
FROM Sales.SalesOrderDetail
)
SELECT 
O.SalesOrderDetailID AS [Detail ID],
O.ProductID,
Rows.[Row Number]
FROM Sales.SalesOrderDetail AS O
JOIN Rows on Rows.[Detail ID] = O.SalesOrderDetailID
WHERE Rows.[Row Number] BETWEEN 100 AND 200
a
b
c
d
