sql get all users that are related to one code example Example: sql server get users select * from master.sys.server_principals