Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve partial data in SQL Server ?

 
samit majumdar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to display 4 columns of a particular table. The browser

is displaying 50 records per page. 'Next' and 'Previous' buttons are

there for navigating through all the records. It may have even 1

million or more records. The table may have n number of records. I am

not getting any problem if the record size is approximately 50,000.

But for large number of records say, 1 lac or more, the browser is

taking too much time...roughly, for 1 lac record it is taking 35

seconds and for 2.5 lac record it is taking 4 minutes...as the no of

records fetched increases...page loading time also increases

exponentially. So, my aim is to collect partial data from the table

and display it. In oracle I can manage it using rownum and minus

clause, efficiently. But in SQL Server I am not able to handle it,

using those technique. My application runs both on Oracle and SQL

Server. Can anybody help me?

For more clarity :::: I want to collect 1 to 50 records from the

table. next time I want to collect records from 51th. position to

100th. position. And then from 101th. position to 15oth. and so on.
Of course in SQL Server.

I am writing my code in JSP.

Thanks -

Samit
[ July 21, 2005: Message edited by: samit majumdar ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are some notes on prior pagination discussions. See if any of these ideas fit your situation. Let us know if you think of better ones!
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i want to develop the list which shows only 10 records at a time but the table may have 50,000 qualifiing
records for my query ..i have to naigaet using the prev and fwd buttons what is the best way to do....
i tried setFetcsize(num); but in vain...
is there any link that i can use it for iterate the resultset (10 records at a time) ,
i stored the romnum in session for each fwd button i increased by "10" and send to database is this
way appreciatable..
Pls suggest
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic