SELECT TOP 50 column
FROM table

----- Original Message -----
From: Steve Oliver <[EMAIL PROTECTED]>
Date: Thursday, January 31, 2002 2:48 pm
Subject: MSSQL and LIMIT

> I am doing a query on a rather large table, lets say there are 2000
0
> rows, and I want to display them on a page, 50 rows at a time, 

> startingfrom 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 curso
r,
> 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?sideb
ar=lists
> 
______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to