INF: User-Defined Counters Do Not Show Up Correctly in Perfmon

Last reviewed: April 9, 1997
Article ID: Q161347
The information in this article applies to:
  • Microsoft SQL Server, version 6.5

SUMMARY

Microsoft SQL Server version 6.5 allows you to define your own performance counters. See the "SQL Server User-Defined Countered Object" section in the SQL Server Books Online for complete details.

The documentation states that the stored procedure you create should return a single integer as a result. However, you can generate multiple result sets in a stored procedure. In that case, the SQL Server performance DLL (Sqlctr60.dll) interprets each result set as a counter.

MORE INFORMATION

The following is an example of a stored procedure that generates multiple result sets:

   create procedure spTest
   as
      select 1
      select 2
   go

If your procedure generates two result sets, counter 1 may appear in counter 2.

You can use the "set nocount on" command to reduce the number of DONE_IN_PROC messages. You can also use trace flag 3640. The following is an excerpt from the Trace Flags section of the SQL Server Books Online.

   Eliminates the sending of DONE_IN_PROC messages to the client for each
   statement in a stored procedure. This is similar to the session setting
   NOCOUNT, but when set as a trace flag every client session is handled
   this way.


Additional query words: Perfmon Performance Monitor winnt nt
Keywords : kbother kbusage SSrvGen
Version : 6.5
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.