title: How to get the WINDOWS USER within "EXECUTE AS OWNER"
body: <p>Is there a function which returns the WINDOWS USER (NOT the database user!) within a procedure which is "EXECUTE AS OWNER" ?</p>
  
  <p>Will ORIGINAL_LOGIN() do this, or does that only return the database user ?</p>
  
  <p>Consider the following situation:</p>
  
  <ul>
  <li>Windows Users "joe" and "anne" are part of a Active Directory Group, e.g. "PLANNERS"</li>
  <li>The SQL Server Database has "PLANNERS" as Server Login and as Database User. </li>
  <li>There is stored procedure WITH EXECUTE AS OWNER</li>
  </ul>
  
  <p>Now, anne is logging into the SQL Database via Windows Authentification (so she is database user "PLANNERS"), and she calls the procedure. In this procedure, I want to retrieve the Windows User ("anne"). </p>