February 27, 2013 at 3:39 am
In SQL 2000, 2005, 2008, 2008r2
How to retrieve the permission for the default Public role in an db
February 27, 2013 at 4:06 am
2005/2008 it would be something like this: -
SELECT a.principal_id, a.name, OBJECT_NAME(b.major_id) AS [object], b.[permission_name], b.state_desc
FROM sys.database_principals a
LEFT OUTER JOIN sys.database_permissions b ON a.principal_id = b.grantee_principal_id
WHERE a.name = 'public';
You'd need to look up the mappings to 2000 to figure out an equivalent there --> http://msdn.microsoft.com/en-us/library/ms187997.aspx%5B/url%5D
February 27, 2013 at 4:27 am
Cadavre
Your query works. Is it the same as the one
select (major_id),OBJECT_NAME(major_id),grantee_principal_id,permission_name,state_desc from sys.database_permissions
where grantee_principal_id=0
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply