[thelist] limiting search results by number (SQL Server 7)

Roee Rubin webdesign1 at irubin.com
Sun Dec 9 10:53:18 CST 2001


If you are using Perl try the HTML::Pager module.

Roee
roee at irubin.com

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Chris Blessing
Sent: Sunday, December 09, 2001 12:15 AM
To: thelist at lists.evolt.org
Subject: [thelist] limiting search results by number (SQL Server 7)


Hi all-

What I want to do is display a certain number of results per page based on
the number of rows I retreive from a table.  I say 'search' because I'm
using SQL Server's full-text search capability and it is, in effect,
propelling a small search engine for my company's internal use.

Specifically I want to enable the "Viewing results 1-20 of XXXX" and
"21-40", etc. etc.  I know I can do this by retreiving the full recordset
everytime the user decides to "view more results", but I don't want to do
that.  I'd rather let the db decide which rows to return based on the query.
I remember seeing an article on this somewhere which used php/mysql but it
also used the LIMIT clause, which SQL server doesn't apparently support (as
far as I can tell).  Anyone have any tips or advice on how to go about doing
this?  If I choose the full-recordset method I will be returning hundreds
upon thousands of rows everytime but only showing 21-40 or 101-120 (and so
on).  I'd really rather not do that.

Thanks in advance!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

<tip type="Moving data from mySQL to MS SQL 7">
note: this tip applies to Windows machines.

If you want to move data from a mySQL database to an MS SQL database, it's
simple with the MS SQL Data Transformation wizard and myODBC (available @
http://www.mysql.com/downloads/api-myodbc.html).

I figured this out after many trials with attempting to import a text file
dumped from a mySQL db which had a text field in it (very hard to delimit
text fields in a text file, if you know what I mean).

After you setup the myODBC driver on your system you'll need to configure
the default DSN.  Go to the ODBC Data Source Administrator and configure the
mySQL User DSN.  Put in the remote mySQL host, database and
username/password.  Now open the MS SQL Enterprise Manager, select your
database, right-click and select "Import Data...".  When you get to the
"Source" screen, select the mySQL DSN from the drop-down.  After you specify
the destination, the wizard should show you a list of available tables to
import.  From here you can transform the data to meet your needs as
necessary.  Then let the wizard do its work.  It'll get all the data you
request and preserve as many of the field data types as it can.  It even
transfers text fields!  Very handy tool for migrating lots of data in a
little bit of time.
</tip>


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list