在同一台服务器上使用两个不同的数据库 [英] Working with in two different databases on the same server

查看:305
本文介绍了在同一台服务器上使用两个不同的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一服务器上有两个数据库dbOne和dbTwo,分别有用户dbUser_1和dbUser_2。现在我想在dbTwo中从dbOne调用sp,但是它给出了错误消息。



服务器主体dbUser_2无法访问当前安全上下文下的数据库dbOne。



它在我的最后工作正常但不在服务器上工作。



如何在服务器端配置/设置我的权限。



请用例子发送答案

I have two databases on the same server dbOne and dbTwo having user respectively dbUser_1 and dbUser_2. Now I want to call sp from dbOne in dbTwo, but it gives error msg.

The server principal "dbUser_2" is not able to access the database "dbOne" under the current security context.

It works properly at my end but not working on server.

How can I configure / setup my permissions on server side.

Kindly send answer with examples

推荐答案

我搜索了在sql server中访问另一个数据库 [ ^ ](事实上谷歌建议我尽快我先写了几个字)。结果中的第二个链接 - 授予对一个数据库的访问权限对另一个用户/角色的影响 [ ^ ]似乎是最明显的谈论你想要的东西。通过结果,你一定会找到你的答案。请在询问前进行搜索。
I searched for access one database from another in sql server[^] (infact Google suggested me this as soon as I wrote first couple words). The second link from the result - Granting access to one db to users/roles of another[^] seemed the most obvious which talks about what you want. Go through the results you will certainly find your answer. Please search before you ask.


您需要在第一个数据库上授予第二个用户(dbUser_2)访问权限:目前只有dbUser_1可以访问dbOne,并且只有dbUser_2可以访问dbTwo 。由于您的登录连接是指特定数据库和特定用户,因此您需要使用单个用户(错误)或提供足够的dbUser_2权限以在dbOne上运行SP - 这取决于SP的作用:如果它使用INSERT或UPDATE,那么用户将需要写权限等等。
You need to give the second user (dbUser_2) access permissions on the first database: at the moment only dbUser_1 has access to dbOne and only dbUser_2 has access to dbTwo. Since your login connection refers to a specific DB and a specific user, you need to either use a single user for both (bad) or give sufficient permissions of dbUser_2 to run the SP on dbOne - and that will depend on what the SP does: if it uses INSERT or UPDATE then the user will need write permissions and so forth.


这篇关于在同一台服务器上使用两个不同的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆