Hi Usman,
Below query will help you get direct access rights and role rights for a user. and you can assign same to new user
select distinct 'role ' as typeofright, a.grantee as username, a.rolename as rolename, databasename, accessright
from dbc.rolemembers a
join dbc.allrolerights b on a.rolename=b.rolename
and a.grantee='tduser'
union
select distinct 'direct' as typeofright, username, ' 'as rolename, databasename, accessright from dbc.allrights
where username='tduser'
Thanks
Harpreet
↧