3.1.4.2.2.1.3.44.1 Columns

The DISCOVER_SESSIONS rowset contains the following columns.

Name

Type

Restriction

Description

SESSION_ID

xsd:string

Yes<309>

The session unique identifier, as a GUID.

SESSION_SPID

xsd:int

Yes

The session ID.

SESSION_CONNECTION_ID

xsd:int

Yes

The connection identifier for the session.

SESSION_USER_NAME

xsd:string

Yes

The session user name.

SESSION_CURRENT_DATABASE

xsd:string

Yes

The name of the database that is being used by the current command execution, or the database that was used by the last command executed.

SESSION_USED_MEMORY

xsd:int

The current size of memory used by the session in kilobytes.

SESSION_PROPERTIES

xsd:string

Reserved for future use.

SESSION_START_TIME

xsd:dateTime

The date and time the session started as UTC time to the server.

SESSION_ELAPSED_TIME_MS

xsd:unsignedLong

Yes<310>

Elapsed time, in milliseconds, since the start of the session.

SESSION_LAST_COMMAND_START_TIME

xsd:dateTime

The UTC server time at the moment the last command started executing.

SESSION_LAST_COMMAND_END_TIME

xsd:dateTime

The UTC server time at the moment the last command finished executing.

SESSION_LAST_COMMAND_ELAPSED_TIME_MS

xsd:unsignedLong

The time, in milliseconds, since the start of SESSION_LAST_COMMAND.

SESSION_IDLE_TIME_MS

xsd:unsignedLong<311>

Yes

The idle time, in milliseconds, since the start of the session.

SESSION_CPU_TIME_MS

xsd:unsignedLong

Yes

The CPU time, in milliseconds, consumed by all requests since the beginning of the session.

SESSION_LAST_COMMAND

xsd:string

The text of the current command executing or the last command executed.

SESSION_LAST_COMMAND_CPU_TIME_MS

xsd:unsignedLong

The CPU time, in milliseconds, consumed by SESSION_LAST_COMMAND.

SESSION_STATUS

xsd:int

Yes<312>

The activity status of the session.

  • 0 - Idle: No current activity is ongoing.

  • 1 - Active: The session is executing some requested task.

  • 2 - Blocked: The session is waiting for a resource to continue executing the suspended task.

SESSION_READS

xsd:unsignedLong

The accumulated number of disk reads since the start of the session.

SESSION_WRITES

xsd:unsignedLong

The accumulated number of disk writes since the start of the session.

SESSION_READ_KB

xsd:unsignedLong

The accumulated value of data read from disk, in kilobytes, since the start of the session.

SESSION_WRITE_KB

xsd:unsignedLong

The accumulated value of data written to the disk, in kilobytes, since the start of the session.

SESSION_COMMAND_COUNT

xsd:int

The number of commands that started execution since the beginning of the session.

RESTRICT_CATALOG_NAME

xsd:string

Unused.

RESTRICT_CATALOG_ID

xsd:string

Unused.

THREAD_POOL_USED

xsd:string

The name of the thread pool on which the command is executing.

REQUEST_ACTIVITY_ID

uuid

The unique identifier of the request activity.

CLIENT_ACTIVITY_ID

uuid

The unique identifier of the client activity.

The rowset is not sorted.

The response has the following definition.

       <xsd:element name="root">
         <xsd:complexType>
           <xsd:sequence minOccurs="0" maxOccurs="unbounded">
             <xsd:element name="row" type="row" />
           </xsd:sequence>
         </xsd:complexType>
       </xsd:element>
       <xsd:simpleType name="uuid">
         <xsd:restriction base="xsd:string">
           <xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-
                               [0-9a-zA-Z]{12}" />
         </xsd:restriction>
       </xsd:simpleType>
       <xsd:complexType name="row">
         <xsd:sequence>
           <xsd:element sql:field="SESSION_ID" name="SESSION_ID" type="xsd:string" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_SPID" name="SESSION_SPID" type="xsd:int" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_CONNECTION_ID" name="SESSION_CONNECTION_ID" 
                        type="xsd:int" minOccurs="0" />
           <xsd:element sql:field="SESSION_USER_NAME" name="SESSION_USER_NAME" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="SESSION_CURRENT_DATABASE" name="SESSION_CURRENT_DATABASE" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="SESSION_USED_MEMORY" name="SESSION_USED_MEMORY" 
                        type="xsd:int" minOccurs="0" />
           <xsd:element sql:field="SESSION_PROPERTIES" name="SESSION_PROPERTIES" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="SESSION_START_TIME" name="SESSION_START_TIME" 
                        type="xsd:dateTime" minOccurs="0" />
           <xsd:element sql:field="SESSION_ELAPSED_TIME_MS" name="SESSION_ELAPSED_TIME_MS" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_LAST_COMMAND_START_TIME" 
                        name="SESSION_LAST_COMMAND_START_TIME" type="xsd:dateTime" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_LAST_COMMAND_END_TIME" 
                        name="SESSION_LAST_COMMAND_END_TIME" type="xsd:dateTime" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_LAST_COMMAND_ELAPSED_TIME_MS" 
                        name="SESSION_LAST_COMMAND_ELAPSED_TIME_MS" type="xsd:unsignedLong" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_IDLE_TIME_MS" name="SESSION_IDLE_TIME_MS" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_CPU_TIME_MS" name="SESSION_CPU_TIME_MS" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_LAST_COMMAND" name="SESSION_LAST_COMMAND" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="SESSION_LAST_COMMAND_CPU_TIME_MS" 
                        name="SESSION_LAST_COMMAND_CPU_TIME_MS" type="xsd:unsignedLong" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_STATUS" name="SESSION_STATUS" type="xsd:int" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_READS" name="SESSION_READS" type="xsd:unsignedLong" 
                        minOccurs="0" />
           <xsd:element sql:field="SESSION_WRITES" name="SESSION_WRITES" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_READ_KB" name="SESSION_READ_KB" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_WRITE_KB" name="SESSION_WRITE_KB" 
                        type="xsd:unsignedLong" minOccurs="0" />
           <xsd:element sql:field="SESSION_COMMAND_COUNT" name="SESSION_COMMAND_COUNT" 
                        type="xsd:int" minOccurs="0" />
           <xsd:element sql:field="RESTRICT_CATALOG_NAME" name="RESTRICT_CATALOG_NAME" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="RESTRICT_CATALOG_ID" name="RESTRICT_CATALOG_ID" 
                        type="xsd:string" minOccurs="0" />
           <xsd:element sql:field="THREAD_POOL_USED" name="THREAD_POOL_USED" type="xsd:string" 
                        minOccurs="0" />
           <xsd:element sql:field="REQUEST_ACTIVITY_ID" name="REQUEST_ACTIVITY_ID" type="uuid" 
                        minOccurs="0" />
           <xsd:element sql:field="CLIENT_ACTIVITY_ID" name="CLIENT_ACTIVITY_ID" type="uuid" 
                        minOccurs="0" />
         </xsd:sequence>
       </xsd:complexType>