title: SQL Server 2019 - suspicious values in sys.sm_exec_sessions.last_request_end_time
body: <p>We continuously gather data from <code>sys.sm_exec_sessions</code> and <code>sys.dm_exec_requests</code> to be able further investigate our locking and performance issues.</p>
  <p>In some cases, I can see that multiple queries to <code>sys.sm_exec_sessions</code> returns the same value of <code>last_request_start_time</code> but different (not-null) values of <code>last_request_end_time</code>.</p>
  <p>Is it standard behavior? What does it mean when one request has multiple end times?</p>
  <p>Regarding to <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sessions-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">documentation</a>, I would expect that each change to <code>last_request_start_time</code> should be followed with just one change of <code>last_request_end_time</code>. Am I missing something?</p>
  <blockquote>
  <p><strong>last_request_start_time</strong>   Time at which the last request on the session began. This includes the currently executing request. Is not nullable.</p>
  <p><strong>last_request_end_time</strong> Time of the last completion of a request on the session. Is nullable.</p>
  </blockquote>
  <p>Example bellow shows result of five subsequent queries to sys.dm_exec_requests. Each call returns one record. All results shows  same sart_time but unique end_time.</p>
  <pre><code>select 
      es.session_id,  
      es.program_name,
      es.last_request_start_time,
      es.last_request_end_time
  from 
      sys.dm_exec_sessions es 
  where 
      es.session_id = 124
  
  1. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:00:58.050
  2. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:02:16.333
  3. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:02:43.640
  4. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:03:02.520
  5. 124    Worker@72045511    2022-04-04 14:43:19.993    2022-04-04 15:03:07.887
  </code></pre>