Search This Blog

Wednesday, November 20, 2013

How to get SQL Server authentication logins

SQL Server > System Views > Catalog > sys.sql_logins

sys.sql_logins returns information about SQL Server authentication logins.

Example:

SELECT m.name, m.principal_id, m.type_desc, m.password_hash FROM master.sys.sql_logins m

Result:

name principal_id type_desc password_hash
sa 1 SQL_LOGIN 0x0200D225062FC1F5301DB7D08706A19C5CC900AB979B59D33B8ACB61F5

D5FCCF9BA0CE660B47435B9A5BD1F06D63C56A4DC6FB69EA429978866AEE29FA440F4E3D
4AE336D3D2