How to get the list of all database users

前端 未结 6 1880
感情败类
感情败类 2021-01-30 06:40

I am going to get the list of all users, including Windows users and \'sa\', who have access to a particular database in MS SQL Server. Basically, I would like the list to look

6条回答
  •  有刺的猬
    2021-01-30 07:00

    SELECT name FROM sys.database_principals WHERE
    type_desc = 'SQL_USER' AND default_schema_name = 'dbo'
    

    This selects all the users in the SQL server that the administrator created!

提交回复
热议问题