PtiTom

SQL Server - ListLogins

May 23rd, 2020
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT * FROM sys.syslogins sl
  2. RIGHT OUTER JOIN sys.server_principals sp on sp.SID = sl.SID
  3. LEFT OUTER JOIN sys.server_role_members srm ON srm.role_principal_id = sp.principal_id
RAW Paste Data