I’m using SQL Server 2005
I have a user. We’ll call him User1. He has access like so:
DB1 (read,write,execute)
DB2 (read,execute)
Here’s what happens:
DB1..Table1 (can read, just fine)
DB1..Proc1 (reads Table1. works fine)
DB2..Table2 (can read, works)
DB2..Proc2 (reads Table2, works)
DB1..Proc3 (reads Table1 with a join on DB2..Table2...
Msg 916, Level 14, State 1. The server principal “sa” is not able to access the database “DB2” under the current security context.)
BUT!
That same SELECT … JOIN works JUST FINE when not part of a stored procedure.
This is a serious head-scratcher, and it’s holding up my work. Any ideas?
I got it. DB1 needed to be marked as Trustworthy. The installer did it, but the updater apparently needed to do it again when it finished running.