By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

How to deal with big query result?

P: n/a
Greetings,

In my search application, user can type a number to search. I use LIKE in my
query.

If a query result generates over 10,000 recordsets, it may several minutes
to run.

Is there a way to only query certain recordset at a time?

I found in SQL you can use "TOP". Like select TOP 100.... it will return
only top 100 records.

Is there a way to query may be from 101 to 200 then from 201 to 300...

My query is like: Select * from Product where PartNumber like '%" PartNumber
"%'

Any idea is welcome.

Thanks a lot.

Lin Ma

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Yes Lin, this is called "paging"

http://www.aspfaq.com/2120
http://www.aspfaq.com/2352

The use of a temp table to divide all of the records tends to scare people.
Typically, much of the processing time is in transferring the data over the
network and rendering the HTML required to display the data, than the
initial filtering. So give that method a shot.

Also, if a query returns 10,000 rows, you might consider requiring that the
user narrow it down a bit better... e.g. picking categories, or only
choosing results that start with one letter at a time, or ...


"Lin Ma" <a@a.com> wrote in message
news:#S*************@TK2MSFTNGP10.phx.gbl...
Greetings,

In my search application, user can type a number to search. I use LIKE in my query.

If a query result generates over 10,000 recordsets, it may several minutes
to run.

Is there a way to only query certain recordset at a time?

I found in SQL you can use "TOP". Like select TOP 100.... it will return
only top 100 records.

Is there a way to query may be from 101 to 200 then from 201 to 300...

My query is like: Select * from Product where PartNumber like '%" PartNumber "%'

Any idea is welcome.

Thanks a lot.

Lin Ma


Jul 19 '05 #2

P: n/a
http://www.aspfaq.com/2120
http://www.aspfaq.com/2096

Ray at work

"Lin Ma" <a@a.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Greetings,

In my search application, user can type a number to search. I use LIKE in my query.

If a query result generates over 10,000 recordsets, it may several minutes
to run.

Is there a way to only query certain recordset at a time?

I found in SQL you can use "TOP". Like select TOP 100.... it will return
only top 100 records.

Is there a way to query may be from 101 to 200 then from 201 to 300...

My query is like: Select * from Product where PartNumber like '%" PartNumber "%'

Any idea is welcome.

Thanks a lot.

Lin Ma


Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.