How to Perform Paging Operation in SQL Server 2005?

Paging Operation in SQL Server 2005

Here I have 2 parameters @start, @end

declare @start int

declare @end int



set @start = 10

set @end = 20



SELECT * FROM

(SELECT ROW_NUMBER() OVER(ORDER BY [CityID]) AS SNo,

SiteName, Latitude,Longitude FROM Sites) as Result

WHERE SNo >= @start AND SNo <= @end

No comments: