SQL Azure: list all logins and users

When connected to the master DB you can run this query to make a list of the Logins and the Users

select l.name as [login name],u.name as [user name] from sysusers u inner join sys.sql_logins l on u.sid=l.sid

I hope this may work


To find the login mapped for a user, look at the sid column from sys.sysusers.

This value corresponds to the sid column from sys.sql_logins in the master database.

Unfortunately, you cannot discover the login name for the SID while connected to the user database. You must connect separately to the master database once you have the sid and query sys.sql_logins to get the name.