Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grant user role to only select view and nothing else

Status
Not open for further replies.

murphyhg

Technical User
Mar 1, 2006
98
US
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?
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top