Monday, June 11, 2012 3:01 PM
I am trying to find a script for SQL2005 that will list all database roles that have no members.
Does anyone have one? A Google search returned nothing.
Monday, June 11, 2012 4:46 PM
FROM sys.database_principals dp
LEFT JOIN sys.database_role_members drm
ON dp.principal_id = drm.role_principal_id
WHERE dp.type = 'R'
AND drm.role_principal_id IS NULL;
William F. Kinsley
- Marked As Answer by AlHowarth9 Monday, June 11, 2012 4:50 PM
Monday, June 11, 2012 4:50 PM
That worked great!