March 26, 2012 at 10:16 pm
--Return database-level permissions for user.
SELECT su.name, dp.class_desc,dp.permission_name, dp.state_desc
FROM sys.database_permissions dp
JOIN sys.sysusers su
ON su.uid = dp.grantee_principal_id
WHERE dp.grantee_principal_id = DATABASE_PRINCIPAL_ID(shantecostello);
--Return rolememberships for the user
SELECT su1.name as[User], su2.name as [Role]
FROM sys.database_role_members drm
JOIN sys.sysusers su1
ON su1.uid = drm.member_principal_id
JOIN sys.sysusers su2
ON su2.uid = drm.role_principal_id
WHERE su1.name = williamcostello
March 26, 2012 at 10:29 pm
mrwillcostello (3/26/2012)
--Return database-level permissions for user.SELECT su.name, dp.class_desc,dp.permission_name, dp.state_desc
FROM sys.database_permissions dp
JOIN sys.sysusers su
ON su.uid = dp.grantee_principal_id
WHERE dp.grantee_principal_id = DATABASE_PRINCIPAL_ID(shantecostello);
--Return rolememberships for the user
SELECT su1.name as[User], su2.name as [Role]
FROM sys.database_role_members drm
JOIN sys.sysusers su1
ON su1.uid = drm.member_principal_id
JOIN sys.sysusers su2
ON su2.uid = drm.role_principal_id
WHERE su1.name = williamcostello
Might be a few missing quotes.
--Return database-level permissions for user.
SELECT su.name, dp.class_desc,dp.permission_name, dp.state_desc
FROM sys.database_permissions dp
JOIN sys.sysusers su
ON su.uid = dp.grantee_principal_id
WHERE dp.grantee_principal_id = DATABASE_PRINCIPAL_ID('shantecostello');
--Return rolememberships for the user
SELECT su1.name as[User], su2.name as [Role]
FROM sys.database_role_members drm
JOIN sys.sysusers su1
ON su1.uid = drm.member_principal_id
JOIN sys.sysusers su2
ON su2.uid = drm.role_principal_id
WHERE su1.name = 'williamcostello'
March 26, 2012 at 10:46 pm
Thank you.
March 27, 2012 at 6:51 am
good queries
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply