Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 User permissions
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

498 Posts

Posted - 06/10/2013 :  17:10:25  Show Profile  Reply with Quote

Is there any query that we can run to get user permissions on database, table, view, sp level in a given database?


James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 06/10/2013 :  17:40:03  Show Profile  Reply with Quote
See if one of these functions will do what you want:
Go to Top of Page

Constraint Violating Yak Guru

352 Posts

Posted - 06/18/2013 :  15:29:09  Show Profile  Reply with Quote
I found this a while back:
SELECT PER.class_desc                               AS PermClass
      ,PER.[type]                                   AS PermType
      ,ISNULL( + N'.' +,DB_NAME()) AS ObjectName
      ,ISNULL(COL.Name, N'')                        AS ColumnName
      ,                                     AS PrincName
      ,PRC.type_desc                                AS PrincType      
      ,                                     AS GrantorName
      ,PER.permission_name                          AS PermName
      ,PER.state_desc                               AS PermState      
FROM sys.database_permissions           PER
     INNER JOIN sys.database_principals PRC ON PER.grantee_principal_id = PRC.principal_id
     INNER JOIN sys.database_principals GRT ON PER.grantor_principal_id = GRT.principal_id
     LEFT JOIN sys.objects              OBJ ON PER.major_id = OBJ.object_id
     LEFT JOIN sys.schemas              SCH ON OBJ.schema_id = SCH.schema_id
     LEFT JOIN sys.columns              COL ON PER.major_id = COL.object_id AND PER.minor_id = COL.column_id
WHERE PER.major_id >= 0
ORDER BY PermClass

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000