February 4, 2010 at 10:36 pm
Declare @PageSize INT
Declare @PageNumber INT
SET @PageSize = 10
SET @PageNumber = 8
SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY ID) AS ROWID, * FROM Recipients r) AS TAB
WHERE ROWID BETWEEN ((@PageNumber-1)*@PageSize)+1 AND (@PageNumber)*@PageSize
February 4, 2010 at 10:52 pm
Is there a question with the query, or just sharing the query?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 5, 2010 at 1:22 am
See this article (and the following discussion)
February 5, 2010 at 11:01 am
Nice Reference Dave.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply