How can you determine through T-SQL which logins have sysadmin?
Thanking you
-- 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
syslogins
is now deprecated. avoid using it.
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