The solution in that link is impractical for huge result sets. I think you want to perform this paging within sql server, right?There are a lot of server side paging methods - you should search for links and articles here. But in the mean time here is a very simple example of one way. play with changing the parameters to see the effects:declare @page int ,@pageSize int--set your paging parameters (passed into stored procedure)select @page = 2 ,@pagesize = 10select d.rn [rownumber], s.name, s.typefrom (select id,name,rn = row_number() over (order by name) from sysobjects) djoin sysobjects s on s.id = d.idwhere d.rn > (@page-1) * @pagesize and d.rn <= @page * @pagesize
Be One with the OptimizerTG