INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Grant user role to only select view and nothing else

Grant user role to only select view and nothing else

(OP)
I have 2 databases. Let's call them dba and dbb. I have a user in dba called dba_users that needs select and select only for a view in dbb. It is called dbb_view. I am thinking that the best way is to grant a role for that user. dba_user_role.

What is the syntact for creating the user and associating the role to that user and granting the role select only permission for the view?

RE: Grant user role to only select view and nothing else

So part of the key is the users login.. user accounts and roles only exist inside a single db. (unless you created them exactly the same way in other dbs.. )

i.e. if you added them to the database as you were creating the login they will probably have exactly the same name. Adding a user or a role to have select permission on a view is exactly the same.

So.. if you want to give userA from DBA permission to DBB.. you need to find out the login for userA and see what user they are mapped to in DBB. Once you know that, just use the GRANT statement for that user in DBB.

To know what user your login is in DBB. go to security, select the login and view its user mappings in the various dbs.

Does that make sense.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close