2010-02-23 22 views

回答

0

我的猜測是,你要sys.database_permission

-- Find permissions granted to current user directly or that are inherited 
-- from groups or roles 
-- 
select permission_name from sys.database_permissions 
    where grantee_principal_id in 
     (
      select user_id() 
     union 
      select dbp.principal_id from sys.login_token lt, sys.database_principals dbp 
       where lt.sid = dbp.sid 
     union 
      select dbrm.role_principal_id from sys.database_role_members dbrm 
       where dbrm.member_principal_id = user_id() 
     ) 
相關問題