msql server query get user from db code example Example: sql server get users select * from master.sys.server_principals