Service Broker - 存储过程从多个数据库检索数据

发布于 2024-12-19 06:23:33 字数 245 浏览 3 评论 0原文

我们使用 SQL Service Broker 来调用存储过程。 当我们调用从一个执行的存储过程时,该服务代理工作正常 数据库。 但是当它调用另一个从多个数据库检索数据的存储过程时 它抛出错误“服务器原理无法访问“databseB”,在当前安全上下文下”。两个数据库使用相同的登录名和用户名。 我尝试按照微软网站更新登录名。我尝试了各种方法, 还是没有成功。但是这个存储的 Proc 当正常执行时它执行时没有 任何问题。但当服务代理调用时,它失败了。 知道可能是什么问题。

We are using SQL Service Broker for calling a Stored Proc.
This service broker is working fine when we call the stored proc which executes from one
database.
But when it calls another Stored Proc which retrieves data from multiple databases
its throwing error " The server Principle not able to access the "databseB",under the current security context". Both the databases use the same login and user name.
I tried to update the login name as per microsoft website. I tried all sorts for things,
still not succesfull. But this stored Proc when execute normally it executes without
any problem. But when called from a Service Broker its failing.
Any idea what could be the issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的影子我的梦 2024-12-26 06:23:33

这是一个权限问题。将用户添加到数据库的 db_owner 角色应该可以解决此问题。

还将数据库设置为“可信”。

This is a permission issue. Adding the user to the db_owner role of the database should solve this problem.

Also set the databases to Trustworthy on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文