I have a SQL account 'ABC' with sysadmin credentials and access to all databases on the server, let's say database A and database B. In contrast, my program employs individuals that have access to only one database A.
I wrote a stored procedure to insert records into the tables of database B. So I'm using the EXECUTE AS clause to execute a stored procedure with user ABC, but after some testing, I discovered from this source that if my application users don't have the exact same server roles as user ABC, it doesn't work. When I make another user sysadmin, there are no errors and everything works well. What is the point of this EXECUTE AS command if both users must have the same roles?
Replies