-1

How can you determine through T-SQL which logins have sysadmin?

Thanking you

0

1 Answer 1

0

-- sysadmin = 1 indicates that the login has sysadmin

SELECT name, dbname DBNAME,sysadmin SYSADMIN, denylogin, isntname, isntgroup, isntuser

FROM master.dbo.syslogins

WHERE sysadmin = 1

3
  • 1
    syslogins is now deprecated. avoid using it.
    – user37701
    Commented Jan 8, 2018 at 3:46
  • Which version is it deprecated? I am using 2008 - 2017
    – A.Chetcuti
    Commented Jan 8, 2018 at 3:59
  • All the dbo.sys* views are deprecated since version 2005, if memory serves. There are typically similarly named views in the sys schema nowadays. Commented Jan 8, 2018 at 7:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.