Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12554

Lost All User Database Permissions

$
0
0

A tool used to copy permissions unfortunately wiped out permissions for users. The logins and respective database user accounts are still there but the permissions are gone. I was wondering if there is a easier way than restoring each of the 20+ databases into another test server and finding permissions using the script,



SELECT        A.name AS 'Database Role', B.name AS 'UserName',  SUSER_SNAME(B.sid) [Login]

FROM          sys.database_role_members C

INNER JOIN    sys.database_principals A ON A.principal_id = C.role_principal_id

INNER JOIN    sys.database_principals B ON B.principal_id = C.member_principal_id

As it appears as though the actual user permissions are saved on the database. Would restoring only master work?

Thank you.

-Jeelani

Viewing all articles
Browse latest Browse all 12554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>