There is a user and two databases on server (db1 and db2). User can connect to server having default database db1 where he can exec sp. In sp syntax we use synonyms for db2 tables under dbo scheme.
All that is done in order to allow user just connect and exec one stored procedure. It worked noraml but now The server principal "user" is not able to access the database "db2" under the current security context
.
User gets output from sp when code does not touch synonyms to db2. What should be updated? I cant grant select to开发者_如何学Python user for db2 objects.
I know the question is old, but still relevant
- the procedure has to have permission on the synonym object
- the procedure has to have permission on the object the synonym is targeting
- you have to correctly setup trustworthy database property
By default, the procedure executes under the caller account, but it can be changed with execute as clause.
精彩评论