Re: MsSQL LIMIT limit
| From: | Frank M. Kromann | Date: | Thu, 21 Dec 2000 22:16:38 +0000 |
| Subject: | Re: MsSQL LIMIT limit | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31481@lists.php.net to get a copy of this message | ||
MS SQL Server does not know the keyword limit.
You can send an extra query before your actual query
SET ROWCOUNT 5
This will limit all following queryes in the same session to get 5 rows only.
On MS SQL Server 7.0 you can also use
SELECT TOP 5 * FROM table.
This will do the same but only for a single query.
- Frank
>Hello,
>
>I have built a backend system with MySQL and ODBC/MySQL
>and , in viewing search results, for buttons like Back and Next
>I used MySQL specific LIMIT. Thing is I have to port the system
>on MsSQL.
>Now I have to rewrite some code and I suppose I could do 2 things.
>1. Rewrite entire code before calling database object's ExecuteQuery
>method and not base on LIMIT anymore. (sometimes it was really
>necessary, sometimes only for speed reasons)
>2. Rewrite the ExecuteQuery method of database object the way
>that when he sees LIMIT manually generates desired output.
>
> What would be the option you would follow if you were me?
>Do you have other solutions?
>
>Regards,
>Uioreanu Calin
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>