How to Get information of all SQL Logins and Windows users in SQL SERVER SELECT name AS Login_Name,TYPE, type_desc AS Account_Type FROM sys.server_principals WHERE TYPE IN (‘U’, ‘S’, ‘G’) ORDER BY name, type_desc