简体   繁体   中英

Grant SQL User to view all SQL Server users

Is it possible to grant a SQL Server user permissions to query all SQL Server users, without adding the user to the sysadmin group from security?

If yes, could you please guide me?

Thank you + BR

Microsoft SQL Server 2016

You can grant him VIEW ANY DEFINITION privilege. It still grants more than required but it's not sysadmin role.

Try this

USE master;  
GRANT SELECT ON sys.database_principals TO YourUser;  
GRANT VIEW SERVER STATE to YourUser;  
GO  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM