开发者

security context problem when accessing through synonyms

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.

security context problem when accessing through synonyms


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜