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
Thank you.
-Jeelani