Microsoft KB Archive/926899

= When you use SQL Profiler to create a trace in SQL Server 2005, the Existing Connection event appears after other events that are logged for the same session ID =

Article ID: 926899

Article Last Modified on 11/20/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Workgroup Edition
 * Microsoft SQL Server 2005 Standard X64 Edition
 * Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Enterprise X64 Edition
 * Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems

-



SYMPTOMS
When you use SQL Profiler to create a SQL Server trace in Microsoft SQL Server 2005, the Existing Connection event appears after other events that are logged for the same session ID (SPID). For example, you may receive the following events in SQL Profiler. SPID  EVENT                 EVENT SEQ -   --   -- 100    Batch Starting           10 100   Batch Completed          50 100   Existing Connection      60 100   Batch Starting           52 100   Batch Completed          54 In this example, the Existing Connection event should contain a sequence number that is less than 10. Instead, the sequence number is 60.

When you replay the trace, SQL Profiler uses the Existing Connection event to establish the correct settings for the connection. Therefore, the activity that occurs before this event may not replay correctly.

Note This problem is not limited to SQL Profiler. Any trace in SQL Server 2005 may experience the problem.



CAUSE
This problem occurs because all worker threads can produce events when a trace is created. The worker thread that creates the new trace definition starts the trace for all workers and then produces the Existing Connection events. Other worker threads can generate events at the same time. These events mix with the Existing Connection events.



WORKAROUND
To work around this problem, sort the traces by using the Event Sequence column. This workaround does not always solve this problem. If sorting does not work, you can safely ignore all events before the Existing Connection event for the SPID when you try to replay activities.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbtshoot kbprb kbexpertiseadvanced kbsql2005tool KB926899

-

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

© Microsoft Corporation. All rights reserved.