Question

I have 2 database users called SQLUser1 and SQLUser2. How can I grant INSERT permission to SQLUser2 at database level using SQLUser1?

After reading about database membership roles, I think I can achieve the solution by playing with memberships of SQLUser1. Can it be solved by giving db_securityadmin and db_accessadmin to SQLUser1?How can I control permissions of one user by another user in database level?

Any help appreciated.

Thanks, Deeps

Was it helpful?

Solution

You must grant all/specific privilege to SQLUser1 with grant option as sa (sys admin or other higher privileged user). Then SQLUser1 will become eligible to grant privilege to SQLUser2 as outlined below

GRANT ALL TO SQLUser1 WITH GRANT OPTION

You need not to assign ALL privilege to SQLUser1. Even SQLUser1 can have only INSERT permission but WITH GRANT OPTION make him eligible to grant the same permission to other user.

Then as SQLUser1 grant specific privilege to SQLUser2

GRANT INSERT TO SQLUser2 

You can do the above mentioned steps using GUI (SSMS) as well.

For more information on GRANT see HERE

OTHER TIPS

you need to use a user which is db_owner.

Select the user2 and click Properties, then user mappings... using SQL Server Management Studio.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top