MSDN, TechNet, Books Online and other sources outline what Multiple Active Result Sets (MARS) is, how to use it and transaction scopes. Working on an issue this week I found I needed to understand what the trace looked like. In doing so I found the following helpful.
The trace column (
) represents the logical connection id for a MARS connection.
ODBC / ADO / SQLConnection / SQLOLEDB
The following, simplistic example, shows
HBDC: ODBC connection opening (RequestId = 0)
HSTMT: (1) select * from dm_os_workers (RequestId = 1)
HSTMT: (2) select * from dm_os_workers, dm_os_threads (RequestId = 2)
The HSTMT's become logical connections for SPID/Session 52.
This can become a bit muddy when you use SQL Server HTTP end-points. HTTP endpoints set the RequestId but
HTTP is not MARS enabled
. Multiple requests submitted on the same HTTP session will be processed in received.