SALES: 1-800-867-1380

sys.dm_exec_sessions (Azure SQL Database)

This topic is OBSOLETE. You can find the most current version in the SQL 14 Transact-SQL Reference.

ImportantImportant
This topic is not maintained. For the current version, see sys.dm_exec_sessions (Transact-SQL).

Returns information about all active user connections and internal tasks.

 

Column name Data type Description

session_id

smallint

Identifies the session associated with each active primary connection. Is not nullable.

login_time

datetime

Time when session was established. Is not nullable.

host_name

nvarchar(128)

Name of the client workstation that is specific to a session. The value is NULL for internal sessions. Is nullable.

program_name

nvarchar(128)

Name of client program that initiated the session. The value is NULL for internal sessions. Is nullable.

host_process_id

int

Process ID of the client program that initiated the session. The value is NULL for internal sessions. Is nullable.

client_version

int

TDS protocol version of the interface that is used by the client to connect to the server. The value is NULL for internal sessions. Is nullable.

client_interface_name

nvarchar(32)

Protocol name that is used by the client to connect to the server. The value is NULL for internal sessions. Is nullable.

security_id

varbinary(85)

Microsoft Windows security ID associated with the login. Is not nullable.

login_name

nvarchar(128)

Microsoft Azure SQL Database login name under which the session is currently executing. It should correspond to the security_id.

noteNote
Reserved for future use. Future compatibility is not guaranteed.

nt_domain

nvarchar(128)

Windows domain for the client if the session is using Windows Authentication or a trusted connection.

noteNote
In Microsoft Azure SQL Database, this column always returns NULL.

nt_user_name

nvarchar(128)

Windows user name for the client if the session is using Windows Authentication or a trusted connection.

noteNote
In Microsoft Azure SQL Database, this column always returns NULL.

status

nvarchar(30)

Status of the session. Possible values:

  • Running - Currently running one or more requests

  • Sleeping - Currently running no requests

  • Dormant – Session has been reset because of connection pooling and is now in prelogin state.

  • Preconnect - Session is in the Resource Governor classifier.

Is not nullable.

context_info

varbinary(128)

CONTEXT_INFO value for the session.

cpu_time

int

CPU time, in milliseconds, that was used by this session. Is not nullable.

memory_usage

int

Number of 8-KB pages of memory used by this session. Is not nullable.

total_scheduled_time

int

Total time, in milliseconds, for which the session (requests within) was scheduled for execution. Is not nullable.

total_elapsed_time

int

Time, in milliseconds, since the session was established. Is not nullable.

endpoint_id

int

ID of the Endpoint associated with the session. Is not nullable.

last_request_start_time

datetime

Time at which the last request on the session began. This includes the currently executing request. Is not nullable.

last_request_end_time

datetime

Time of the last completion of a request on the session. Is nullable.

reads

bigint

Number of reads performed, by requests in this session, during this session. Is not nullable.

writes

bigint

Number of writes performed, by requests in this session, during this session. Is not nullable.

logical_reads

bigint

Number of logical reads that have been performed on the session. Is not nullable.

is_user_process

bit

0 if the session is a system session. Otherwise, it is 1. Is not nullable.

text_size

int

TEXTSIZE setting for the session. Is not nullable.

language

nvarchar(128)

LANGUAGE setting for the session. Is nullable.

date_format

nvarchar(3)

DATEFORMAT setting for the session. Is nullable.

date_first

smallint

DATEFIRST setting for the session. Is not nullable.

quoted_identifier

bit

QUOTED_IDENTIFIER setting for the session. Is not nullable.

arithabort

bit

ARITHABORT setting for the session. Is not nullable.

ansi_null_dflt_on

bit

ANSI_NULL_DFLT_ON setting for the session. Is not nullable.

ansi_defaults

bit

ANSI_DEFAULTS setting for the session. Is not nullable.

ansi_warnings

bit

ANSI_WARNINGS setting for the session. Is not nullable.

ansi_padding

bit

ANSI_PADDING setting for the session. Is not nullable.

ansi_nulls

bit

ANSI_NULLS setting for the session. Is not nullable.

concat_null_yields_null

bit

CONCAT_NULL_YIELDS_NULL setting for the session. Is not nullable.

transaction_isolation_level

smallint

Transaction isolation level of the session.

0 = Unspecified

1 = ReadUncomitted

2 = ReadCommitted

3 = Repeatable

4 = Serializable

5 = Snapshot

Is not nullable.

lock_timeout

int

LOCK_TIMEOUT setting for the session. The value is in milliseconds. Is not nullable.

deadlock_priority

int

DEADLOCK_PRIORITY setting for the session. Is not nullable.

row_count

bigint

Number of rows returned on the session up to this point. Is not nullable.

prev_error

int

ID of the last error returned on the session. Is not nullable.

original_security_id

varbinary(85)

Microsoft Azure SQL Database security ID that is associated with the original_login_name. Is not nullable.

original_login_name

nvarchar(128)

Microsoft Azure SQL Database login name that the client used to create this session. It should correspond to original_security_id. Is not nullable.

last_successful_logon

datetime

Time of the last successful logon for the original_login_name before the current session started.

noteNote
In Microsoft Azure SQL Database, this column always returns NULL.

last_unsuccessful_logon

datetime

Time of the last unsuccessful logon attempt for the original_login_name before the current session started

noteNote
In Microsoft Azure SQL Database, this column always returns NULL.

unsuccessful_logons

bigint

Number of unsuccessful logon attempts for the original_login_name between the last_successful_logon and login_time.

noteNote
In Microsoft Azure SQL Database, this column always returns NULL.

group_id

int

ID of the workload group to which this session belongs. Is not nullable.

Requires VIEW DATABASE STATE permission on server.

noteNote
If the user has VIEW DATABASE STATE permission on the server, the user will see all executing sessions on the database; otherwise, the user will see only the current session.

For more information about the sys.dm_exec_sessions system view, see sys.dm_exec_sessions (Transact-SQL) in SQL Server Books Online.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft