title: Running trigger that calls stored procedure on another database
body: <p>We would like to run a trigger on one database (A) that calls a stored procedure on another database (B).</p>
  
  <pre>
  CREATE TRIGGER trg_A ON TableA
  FOR INSERT
  AS
  BEGIN
      EXEC DatabaseB.dbo.stp_B
  END</pre>
  
  <p>We would like to do this as LoginA with UserA on DatabaseA. We also have LoginB with UserB on DatabaseB.</p>
  
  <p>How can we accomplish this?</p>
  
  <p>Currently we get this error message</p>
  
  <pre>The server principal "..." is not able to access the 
  database "DatabaseB" under the current security context.</pre>
  
  <hr>
  
  <p>We have tried <code>WITH EXECUTE AS 'UserB'</code>, without luck.</p>