Monday, March 26, 2012

rights issue

How do I text base add my domain users group with full rights to my database. I am using teratrax to manage my database. This is what comes up when I click on new database user

-- Replace all lower case words with your own code.

EXECUTE SP_GRANTDBACCESS 'login', 'user_name'Hi,

with that statement you posted you only grant database access for an user. The user cannot do anything in your database if you don't grant him further permissions. What exactly do you mean with full rights? Systemadministrators' rights? Or are DBOwner-Rights sufficient?

Otherwise you should create a role which has specific rights in your databases and add the users group to that role.

:)|||Yeah DBOWNER would be enough rights. How do I add roles and then how do I add domain users group to them?|||To create a new role use:

sp_addrole [ @.rolename = ] 'role'
[ , [ @.ownername = ] 'owner' ]

in the specific database.

Grant Permissions to that role for each object needed:

GRANT
{ ALL [ PRIVILEGES ] | permission [ ,...n ] }
{
[ ( column [ ,...n ] ) ] ON { table | view }
| ON { table | view } [ ( column [ ,...n ] ) ]
| ON { stored_procedure | extended_procedure }
| ON { user_defined_function }
}
TO security_account [ ,...n ]
[ WITH GRANT OPTION ]
[ AS { group | role } ]

To add a user or group to a role use:

sp_addrolemember [ @.rolename = ] 'role' ,
[ @.membername = ] 'security_account'

in the specific database.

To add a user/group to the db_owner role use:

sp_addrolemember [ @.rolename = ] 'db_owner' ,
[ @.membername = ] 'security_account'

in the specific database.

EDIT: Replace 'security_account' with your domain users name in the database, e.g.: [domainname\groupname]

:)

No comments:

Post a Comment