sef
sef

Reputation: 5295

How to show SQL server 2000 server roles through an SQL query

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

Upvotes: 1

Views: 5214

Answers (2)

sef
sef

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

devio
devio

Reputation: 37205

EXEC sp_helpuser 'username' should do.

Upvotes: 2

Related Questions