Microsoft KB Archive/69645

PRB: Sp_helpdb Uses the SET NOCOUNT ON SQL Statement ID Number: Q69645

1.10 1.11 4.20 OS/2

Summary:

SYMPTOMS When running sp_helpdb on a database, the number of rows returned in the device column is incorrect. Whatever the number of devices, the display returns “0 rows affected.” However, all of the devices are displayed.

CAUSE The stored procedure sp_helpdb uses the SQL SET statement, SET NOCOUNT ON, to turn off the message at the end of each statement. This message normally tells you how many rows were returned by the query. When this statement is turned off, instead of not displaying the message, it displays “0 rows affected,” regardless of the number of rows returned from the query.

Additional reference words: Transact-SQL