[thelist] SQL Rowcount Problem

Seth Bienek seth.bienek at tempschedulingsystem.com
Fri Jun 21 14:19:10 CDT 2002


Afternoon, y'all.  I have this problem, see...

I have a query (SQL Server, CF5) that returns up to several thousand
rows as a search result.  Due to the nature of the query, at times it
runs long, and adding to the performance issue (I believe) is the fact
that it returns many columns and many rows of data from the SQL Server
via the network, when I only need to display a few at a time (10-50) to
the user.

I need to pull all the rows in order to return the number of matches,
right?  Is there a way to avoid having to handle all the data (and it's
overhead) when I only really want the first x rows and a count of the
total number of matches?

I can use the TOP operator, but it of course returns as the recordcount
only the number of rows returned..  I know there's a way around this,
but the documentation doesn't seem to be much help to me thus far..

Any help is greatly appreciated!

Thanks,

Seth





More information about the thelist mailing list