SQL Azure: list all logins and users

前端 未结 2 1259
挽巷
挽巷 2020-12-31 11:36

I\'m using V12 Azure SQL.

To list all logins (server level) we can use this query on master database:

SELECT *         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 12:38

    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

提交回复
热议问题