Microsoft KB Archive/113851

{|
 * width="100%"|

BUG: DBCOUNT Returns Zero for sp_sqlexec

 * }

Q113851

-

The information in this article applies to:


 * Microsoft SQL Server version 4.2x

-

BUG# NT: 744 (4.2)

SYMPTOMS
When running a query against a remote server using the sp_sqlexec remote procedure, a message indicating that zero rows were affected is displayed by the front end. If the same query is run directly against the remote server, the front end displays the number of rows affected by the last statement in the query.

CAUSE
The DB-Library (DB-Lib) DBCOUNT function returns zero for queries executed using the sp_sqlexec remote stored procedure.

WORKAROUND
Remote execution of a user-defined stored procedure containing the desired query will allow the front end to determine the number of rows affected. If this data is needed by the front end, stored procedures should be created to execute the desired SQL statements instead of executing them in an ad- hoc fashion using sp_sqlexec.

STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 4.2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: rpc Windows NT dblib

Keywords : kbprogramming

Issue type :

Technology : kbSQLServSearch kbAudDeveloper kbSQLServ420OS2