sql server/database roles.

We have a setup on a SQL 2012 server in which there are views and stored procedures on one database that pull from tables on another database (same server). So as far as I can figure out when we need a login to have access to the view we also need to grant rights on the 'tables' database as well. So we have add permissions to one of the databases and then to the other database each time we have a new user that needs access.   If there is no way around this, I would like to create something like a role which is set up with the permissions to the two databases, and then we just add users to the role.

I am reading about 2012 Server Roles and am not figuring out how to do this.
KCTechNetAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
You need to enable database chaining. This requires only connect permissions on the other database.
0
DBAduck - Ben MillerPrincipal ConsultantCommented:
I would not enable database ownership chaining unless it is the last resort. This is a security feature that circumvents some things.  I would create a role in the other database, assign permissions to the database role and map the user of the current database to that database and give that user membership in the role.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
Please read my articles about Views. If after that you still not able to solve your issue, then let me know, so I can help you further.

Understanding the Views scope (i) - Limiting the access to data
Understanding the Views scope (ii) - Ownership chaining
Understanding the Views scope (iii) - The complete security layer
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Recommendation to close this question by accepting the above comments as solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.