title: SQL SERVER changing security contex inside of stored procedure
body: <p>Inside of some stored procedure I have to change security context to more powerful login.
  I tried something like this:</p>
  
  <pre><code>USE ProjectsDB
  EXECUTE AS login = 'sa'
  
  --SOME OPERATIONS
  
  REVERT;
  </code></pre>
  
  <p>but I get the following error message:</p>
  
  <pre><code>Msg 15406, Level 16, State 1, Line 3
  Cannot execute as the server principal because the principal "sa" does not exist,
  this type of principal cannot be impersonated, or you do not have permission.
  </code></pre>
  
  <p>The 'sa' login exist with all needed permissions.
  What may be the problem?</p>
  
  <p>Ilan.</p>