Groups | Blog | Home
all groups > sql server odbc > november 2003 >

sql server odbc : how to get the number of rows returned by a select statement in SQL server 2000


Vishal Prabhu
11/17/2003 2:44:29 PM
Hi,

How can I determine the number of rows returned by a select statement in
SQL server 2000? I do not want to use ' select count(*)...'

the code would be -

retcode = SQLExecDirect(hstmt, (SQLCHAR *)sql_stmt, SQL_NTS);

/* get row count*/
// code to get the number of rows selected.

while ( (retcode = SQLFetch(hstmt) ) != SQL_NO_DATA )
{
.
.
.
}

Thanks in advance.

Vishal Prabhu

*** Sent via Developersdex http://www.developersdex.com ***
Brannon Jones [MS]
11/17/2003 3:53:21 PM
There is no way to do this. Please see a related post in
microsoft.public.data.odbc.

--
Brannon Jones
Developer - MDAC
This posting is provided "as is" with no warranties and confers no rights.

[quoted text, click to view]

AddThis Social Bookmark Button