M
MattC
Hi,
I wanted to take advantage of the Row_Number feature of SQL 2005 to to DB
side paging. However, currently I perform my sorting on the front end.
If I perform a sort and then ask for page two, I will retrieve the wrong
items for tha page as the sort item would be wrong.
Is it possible to do something like this?
With Cust AS
( SELECT CustomerID, CompanyName,
ROW_NUMBER() OVER (order by @OrderField) as RowNumber
FROM Customers )
select *
from Cust
Where RowNumber Between @Start and @End
TIA
MattC
I wanted to take advantage of the Row_Number feature of SQL 2005 to to DB
side paging. However, currently I perform my sorting on the front end.
If I perform a sort and then ask for page two, I will retrieve the wrong
items for tha page as the sort item would be wrong.
Is it possible to do something like this?
With Cust AS
( SELECT CustomerID, CompanyName,
ROW_NUMBER() OVER (order by @OrderField) as RowNumber
FROM Customers )
select *
from Cust
Where RowNumber Between @Start and @End
TIA
MattC