Thanks! I was going to write and say that I have been using ADODB but was
unable to make the SelectLimit function work using MS SQL, but I decided to
take a look at my setup one more time.  I have setup my own abstraction
layer on top of ADODB so that I can override some of the default functions
and or adjust them as need be, but it appears that when I wrote the
interface to the SelectLimit function I neglected to send the $nrows and
$offset values to ADODB.  It is now fixed and working nicely.  Thanks again
for the advice.

-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 23, 2003 8:21 PM
To: Grant, Dean (OIT); [EMAIL PROTECTED]
Subject: RE: [PHP-DB] ms sql limit equivalence

> I am just joining this list so if this has been covered in the past I
> apologize.  I am working with MS SQL and would like the functionality
> MySQL's limit function provides.  I understand that MS SQL has no such
> command or equivalent. Has someone found a way to use standard (or MS
> specific) SQL to achieve the same goal?  I have seen bits and pieces
> code
> and ideas here and there, but nothing seems to work.  Any advice would
> appreciated.

In addition to the TOP suggestions, you may want to check out some of
the Abstraction layers out there, i.e. PEAR or ADOdb. I'm pretty sure
they replicate the LIMIT function somehow. You can use one of those
programs or just take when they do and adapt to your needs.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to