title: How SQL Server detect program name in sys.dm_exec_sessions?
body: <p>Can anyone explain the how below mentioned query detect program_name 
  eg: <strong>Microsoft SQL Server Management Studio</strong>,<strong>Microsoft SQL Server Management Studio - Query</strong> etc..</p>
  
  <pre><code>select login_name,program_name,host_name,nt_domain,nt_user_name from sys.dm_exec_sessions 
  </code></pre>