BUG: SQLRowCount Does Not Return Number of Affected Rows in Stored Procedure (187350)



The information in this article applies to:

  • Microsoft SQL Server 6.5
  • Microsoft ODBC Driver for SQL Server 3.5

This article was previously published under Q187350

SYMPTOMS

If any data is modified, updated, or inserted into a table which is contained in a stored procedure, the SQLRowCount function does not return the number of affected rows. It returns a value of -1.

WORKAROUND

To correctly return the number of rows affected, use the @@ROWCOUNT variable in the stored procedure.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in the latest driver 3.60.0310 available with ODBC3.5SDK. A supported fix is now available, but has not been fully regression-tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Technical Support for more information.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbBug kbfix KB187350