I have a trigger that accesses another database. but I receive an error:
"The server principal 'A' is not able to access the database 'B' under the current security context"
Where A is is User login. I then set it to execute as a user which with the same login in both databases (the database from which the trigger is called and the database referenced in the trigger). However, this error persist. I set the referened database to thrustworthy but that did not work.
Also, sa is not a user but a login but when I run the trigger is issued from an sa login without any impersonation, all works well; but all breaks when i try impersonating any user.
How do I have this trigger to run for all users including those not having access to my referenced database