Friday, February 09, 2007

SQL Server 2005: View all permissions

select dp.NAME AS principal_name, dp.type_desc AS principal_type_desc, o.NAME AS object_name,

p.permission_name, p.state_desc AS permission_state_desc

from sys.database_permissions p

left OUTER JOIN sys.all_objects o on p.major_id = o.OBJECT_ID

inner JOIN sys.database_principals dp

on p.grantee_principal_id = dp.principal_id


(found somewhere on web)

1 comment:

Anonymous said...

As written in this eWeek article for viewing and managing sql server permissions you can try new version of security explorer from scriptlogic. I have some experience with their other products and I'm sure this one has the same friendly interface, is stable, and works great.