Microsoft KB Archive/286119

= FIX: Incorrect Behavior in SQL Profiler Event Generation =

Article ID: 286119

Article Last Modified on 10/17/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q286119



BUG #: 234705 (SHILOH_BUGS)



SYMPTOMS
There is a specific change in SQL Profiler in SQL Server 2000 from SQL Server 7.0 in regards to the events that are captured. The specific changes are outlined in the &quot;More Information&quot; section of this article.



RESOLUTION
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack



STATUS
Microsoft has confirmed that this is a problem in SQL Server 2000.

This problem was first corrected in SQL Server 2000 Service Pack 1.



MORE INFORMATION
In SQL Server 7.0, SQL:StmtStarting and SQL:StmtCompleted events display all ad-hoc queries and executed stored procedure events. SP:StmtStarting and SP:StmtCompleted events display all statements within a stored procedure.

Starting in SQL Server 2000, SQL:StmtStarting and SQL:StmtCompleted events display not only the execution of a stored procedure but all the statements within the stored procedure. Due to this change in behavior, the capability of controlling the granularity of information being captured is lost.

This behavior has been changed in SQL Server 2000 Service Pack 1 and the SQL Server 7.0 behavior is restored. You can now capture the individual statements within a stored procedure by using SP:StmtStarting and SP:StmtCompleted events because the statements are no longer mapped to SQL:StmtStarting and SQL:StmtCompleted events.

If you are using T-SQL to access or capture trace data, the StmtCompleted events have the event class numbers specified below if Service Pack 1 has been applied to the server. These are the numbers that you should include to capture these events in a trace (sp_trace_setevent) or search for these events in a trace table or fn_trace_gettable output.   Event Name            Event Number -   SP:StmtCompleted      45 SQL:StmtCompleted    41

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB286119

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.