sqlrx logo
SQLRx® Tip of the Month
 
 
May 2010
Greetings!
 
When you create database objects, you must grant permissions to make them accessible to your users. SQL Server ensures that only principals that have been granted permission can access objects. Here's a query to help you quickly list all principal and object permissions.  And don't forget to regularly monitor the 11 VitalSigns used by SQLRx to debug performance bottlenecks.
 
______________________________________________________________________________
SQL 2008  SQL Server Administration:  List all principal and object permissions with the 
  following query.  Use this to periodically check that permissions have been properly set
  for access to objects in your databases.
 
 

SELECT USER_NAME(p.grantee_principal_id) AS principal_name,

        dp.type_desc AS principal_type_desc,

        p.class_desc,

        OBJECT_NAME(p.major_id) AS object_name,

        p.permission_name,

        p.state_desc AS permission_state_desc

FROM sys.database_permissions p

INNER JOIN sys.database_principals dp

ON p.grantee_principal_id = dp.principal_id

____________________________________________________________ 

SQLRx is now a part of www.msdev.com, Microsoft's training site for solution providers!  Check the site periodically to view new training videos.
 
If you have a SQL question you'd like us to answer, and possibly use for the next SQLRx Tip of the Month or msdev video, email it to us!  If you missed any of our previous tips, you can view them here.
 
For assistance or more information on optimizing your SQL Server Environment, visit us at www.sqlrx.com or email Lori Brown at lorib@isi85.com.  

Sincerely,

Lori Brown | SQLRx Senior Consultant | Integrated Services, Inc.
4144 N. Central Expwy, Suite 430  |  Dallas, TX  75204
Phone: 214.526.7680 x 113 | lorib@isi85.com 
 
 
Integrated Services, Inc.                                    
2008 winner logo small
Turning Data Into Profit
 
25 Years of Credibility & Trust
 

Join our email list          Check out our events          SQLRx Downloads