Have you experimented with the TOP keyword? AS in SELECT TOP 50 name,address,phone,.... FROM TheTable WHERE ......
-----Original Message----- From: Steve Oliver [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 1:48 PM To: CF-Talk Subject: MSSQL and LIMIT 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 ______________________________________________________________________ Get Your Own 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=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

