views:

973

answers:

2

what sql query will i need to show the activated server roles in a specific user?

A: 

EXEC sp_helpuser 'username' should do.

devio
Tnx 4 giving me an idea..
sef
+1  A: 

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

sef