用户权限查询


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
–开连接
CREATE USER [zinnova] FOR LOGIN [zinnova]
GO
 
–开表
GRANT SELECT ON OBJECT::dbo.mdOrderStatus TO zinnova;
GO
 
–查看 SQL 2005 用户被赋予的权限
exec sp_helprotect @username = 'zinnova'
 
–查看用户角色
select DbRole = g.name, MemberName = u.name, MemberSID = u.sid
from sys.database_principals u, sys.database_principals g, sys.database_role_members m
where g.principal_id = m.role_principal_id
and u.principal_id = m.member_principal_id
order by 1, 2

–对象的取得所有权与控制的权限区别
–经测试:取得所有权的权限可以deny,而控制权限忽略deny