Paging in SQL Server problems

Posted by Manh Trinh on Stack Overflow See other posts from Stack Overflow or by Manh Trinh
Published on 2012-10-08T02:27:23Z Indexed on 2012/10/08 9:37 UTC
Read the original article Hit count: 224

I have searched for paging in SQL Server. I found most of the solution look like that

What is the best way to paginate results in SQL Server

But it don't meet my expectation.

Here is my situation:

I work on JasperReport, for that: to export the report I just need pass the any Select query into the template, it will auto generated out the report

EX : I have a select query like this:

Select * from table A

I don't know any column names in table A. So I can't use

Select ROW_NUMBER() Over (Order By columsName)

And I also don't want it order by any columns.

Anyone can help me do it?

PS: In Oracle , it have rownum very helpful in this case.

Select * from tableA where rownum > 100 and rownum <200

Paging with Oracle

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005