Search notes:

SQL Server - sys.server_principals

sys.server_principals lists the (server-)logins. Database users are not found in this view, they're found in database_principals
The column default_database_name shows a login's default database.

Columns principal_id and sid

The values of principal_id and sid identify the principal. These can be converted to the principal's name with suser_name and suser_sname, respectively:
select
   name,
   suser_name(principal_id),
   suser_sname(sid)
from
   sys.server_principals
If the principal corresponds to a Windows user, the value of sid is equal this user's security identifier.

See also

database_principals, sys.login_token, sys.sql_logins, sys.syslogins
The sys schema
SQL Server: login
prinicipal
sys.server_principals selects from the sys.sysxlgns system base table.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1740439606, '18.222.20.252', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/administration/schemas/sys/objects/views/server_principals(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78