note 15458 deleted from function.mssql-fetch-array by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 19:47:15 +0000 |
| Subject: | note 15458 deleted from function.mssql-fetch-array by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22119@lists.php.net to get a copy of this message | ||
Writing a stored procedure using a cursor, or possibly even better using a user defined function
that could actually return the entire recordset (which would actually be much more efficient, as you
could probably do most of it with set statements (insert into... select from), and you wouldn't
have to allocate a cursor, which is costly to sql server performance.
Another way to do it, though it won't work in ALL situations, is briefly outlined in the
article "What's after TOP?" on sqlteam.com. http://www.sqlteam.com/item.asp?ItemID=566
A few other ideas:
Find the id (or whatever you are sorting by) of the last item on the previous page, and then select
top x from the table where that field > that value. this should return the next x rows in that
field, at a very low server cost.
For other SQL server ideas, check out such sites as "sqlteam.com",
"www.sql-server-performance.com", and "sqlmag.com". None of these have php
specific help, but all have ideas that are valid in all languages, and some have ideas for asp pages
that are also valid for PHP.
Hope this helps someone.