Reputation: 5295
what sql query will i need to show the activated server roles in a specific user?
Upvotes: 1
Views: 5214
Reputation: 5295
THIS SHOULD DO IT:
select 'ServerRole' = spv.name, 'MemberName' = lgn.name, 'MemberSID' = lgn.sid
from master.dbo.spt_values spv, master.dbo.sysxlogins lgn
where spv.low = 0 and
spv.type = 'SRV' and
lgn.srvid IS NULL and
spv.number & lgn.xstatus = spv.number
Upvotes: 1