[freetds] Num of rows ruturned by a query
brian.bruns at gmail.com
Thu Apr 28 20:14:24 EDT 2005
This is a protocol limitation. The advantage of sql server doing it
this way is that it can begin returning rows before knowing how many
there will be. That is, if you "order by" an indexed column the
server begins sending rows immediately without building a work table
and therefore the total number is unknown.
Work arounds are to do a count(*) first or to row buffer the results
(if you know the number of rows is relatively small).
On 4/28/05, martin martin <acevedoma at hotmail.com> wrote:
> Is it possible to know how many rows are returned by a "select" query before
> iterating the rows.
> I use a -db-lib- function's "dbcount ()" but it always returns -1 before
> fetching the rows.
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
More information about the FreeTDS