Page 1 of 1

Options.QueryRecCount and select top

Posted: Wed 08 Jun 2011 21:49
by colutti
Hello

I have set:

oMSStoredProc.FetchAll := False;
oMSStoredProc.Options.QueryRecCount := True;

And I have tried to execute a simple query as follow:

select top 100 * from mytable

And the oMSStoredProc.RecordCount property returned more than 100 lines. I think it is a bug.

Posted: Thu 09 Jun 2011 12:55
by AndreyZ
Hello,

The point is that the QueryRecCount property isn't used for stored procedures. Therefore the TMSStoredProc.RecordCount property shows the number of records that were fetched from the server. In any case it cannot be more than the record count of the result dataset.

Posted: Thu 09 Jun 2011 13:02
by colutti
I am not executing stored procedures, and the same thing happens with TMSQuery.

Posted: Fri 10 Jun 2011 09:48
by AndreyZ
For the time being SDAC doesn't take into account the TOP statement in a query for counting records number. We will investigate the possibility of changing such behaviour.