Reputation: 825
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
Upvotes: 1
Views: 109
Reputation: 77926
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
Upvotes: 1
Reputation: 1955
you need to use a user which is db_owner.
Select the user2 and click Properties, then user mappings... using SQL Server Management Studio.
Upvotes: 0