Technical Article

User access management on DB & object level

,

Check the current users DB access at Individual level and manage as per the need and change of role.

It will work on object level also.

----Find the Users access deny level access

SELECT pr.principal_id, pr.name, pr.type_desc, 
pr.authentication_type_desc, pe.state_desc, pe.permission_name
FROM sys.database_principals AS pr
JOIN sys.database_permissions AS pe
ON pe.grantee_principal_id = pr.principal_id
where state_desc='DENY'

----Grant access to user on db level and object level as well

GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE::master TO [domain\username] ---change db name from master to your own db name if needed

---revoke the access 

GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE::master TO [domain\username] ---change db name from master to your own db name if needed

Rate

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(4)

You rated this post out of 5. Change rating

Share

Share

Rate

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(4)

You rated this post out of 5. Change rating