title: SQL Server Execute Impersonation
body: <p>What is the diffrence between... </p>
  
  <pre><code>execute as user = 'testuser'
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>execute as login = 'testuser'
  </code></pre>
  
  <p>I am executing a cross database procedure under these logins and it works with the exececute as login but not the execute as user. It is saying the server principal "testuser" is nt able to access the database "xxx" under the securty context.</p>
  
  <p>When i <code>SELECT SYSTEM_USER</code> after both commands I see that it is set to <code>'testuser'</code></p>