Steve Jones - SSC Editor - Monday, January 16, 2017 11:49 AM
OK, on 5th or 6th pass through this it started to make sense.
Server login mapped to a db user creates a procedure AS SELF, and on this stage the db user which is the author of the proc gets "disconnected", or "orphaned" from from Server login.
Then when procedure is executed it runs under the context of that db user which not necessarily the same user which is currently linked to the current Server login with the same name.
Server needs to "trust" that database to allow its users (which created the procedures back then) perform server-scoped operations.
Such "disconnection" does not happen when executed AS CALLER, obviously.
I made the database TRUSTWORTHY and it indeed fixed the issue.
Thanks.
_____________
Code for TallyGenerator