There are several different DMVs that might be relevant when analyzing the activity that is currently happening on a SQL Server. In this section, we will cover a few of the most common DMVs, along with some examples of the information that they can provide.
Exploring query execution DMVs
sys.dm_exec_sessions
The sys.dm_exec_sessions DMV lists information about all the sessions that are currently active in the server. This includes both user sessions and system sessions, and it also includes idle sessions that are connected but are not currently executing any queries.
Idle sessions can be identified by looking for rows that have a status of sleeping. When using connection pooling especially, it is common to have several user...