I have a user that is attempting to access DatabaseA which he has rights too but he keeps getting the below error (he has access to DatabaseA but doesn't have rights to DatabaseB):
The server principal "Domain\Username" is not able to access the database "DatabaseB" under the current security context.
Because he doesn't have access to DatabaseB, this makes sense at first. Unfortunately, he's not calling DatabaseB in any way.
I've watched this come through the server using Profiler down to the statement levels using no filters. I can see his connections and the error come through but there is no indication that DatabaseB is being hit in any way.
I've reviewed the stored proc that he is attempting to run. It contains a simple select statement that accesses only tables within DatabaseA.
I was able to work around this by giving him access to DatabaseB but this is not a viable long term solution.
I've confirmed that the user is not orphaned
I've searched Google and there are tons of posts regarding this error but none that describe this scenerio.
If anyone has seen this or has an idea about it, I'd truly appreciate it!