首頁 >資料庫 >mysql教程 >SQL Server 2005查看数据库用户权限

SQL Server 2005查看数据库用户权限

WBOY
WBOY原創
2016-06-07 14:56:241242瀏覽

SQL Server 2005查看数据库用户权限 无 use yourdbgoselect 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_i

SQL Server 2005查看数据库用户权限
use yourdb
go

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
go
use master
go

select SrvRole = g.name, MemberName = u.name, MemberSID = u.sid
  from sys.server_principals u, sys.server_principals g, sys.server_role_members m
 where g.principal_id = m.role_principal_id
   and u.principal_id = m.member_principal_id
  order by 1, 2
go
use yourdb
go

exec sp_helprotect @username = 'user name'
go
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn