I am doing a query on a rather large table, lets say there are 20000
rows, and I want to display them on a page, 50 rows at a time, starting
from row 200.

I know in MySQL I can just do a Limit 200,50. But MSSQL doesn't seem to
have anything like that.  I tried a stored procedure to use a cursor,
but that returns 50 recordsets, instead of 50 rows in one recordset.

The way I see it done time and time again is to retrieve all records
with cfquery, then limit the output with cfoutput's startrow and
maxrows, or cfloop's startrow and endrow.

But that would cause the entire query to be retrieved each and
everytime, which seems just plain stupid to me.

The database is updated regularly, so cacheing isn't an option.

Does anyone else have a better way to do this?

______________________
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to