Select TOP ROWNUM
For some of you this may already be common knowledge/everyday
experience, but today was my first time I have
actually used in SQL2005 the "rownum" ( SqlServer Function
row_number() ) feature, here's a small example:
select
* from
(
select *, row_number() over(order by CustomerId) as rownum from customers
) as c
where c.rownum between 1000 and 10000;
this VERY NICE feature along together with the PagedDataSource class enables you paging in .NET 2.0.
We know that the TOP had problems in the SQL2000 and this solves it.