多种存储过程分页方法的速度对比一.TempTable(临时表)The methods in both articles could be optimized with just the Primary Key data copied to the temp ta......
ORDER
BY SortColumn
三.RowCount
The base logic of this method relies on the SQL SET ROWCOUNT expression to both skip the unwanted rows and fetch the desired ones:
DECLARE @Sort
SET
ROWCOUNT @StartRow
SELECT @Sort = SortColumn FROM
Table
ORDER
BY SortColumn
SET
ROWCOUNT @PageSize
SELECT ... FROM
Table
WHERE SortColumn >= @Sort ORDER
BY SortColumn
|