Search notes:

SQL Server - sys.tables

Show user tables of the current schema

Without specially qualifying a database, sys.tables lists the user tables in the «current» database:
select
   tab.type_desc,
   tab.name           table_name,
   tab.object_id,
   sch.name           schema_name,
   tab.create_date,
   tab.modify_date,
   tab.temporal_type_desc,
   tab.uses_ansi_nulls,
   tab.is_ms_shipped
from
   sys.tables   tab join
   sys.schemas  sch on tab.schema_id = sch.schema_id
;
Github repository about-MSSQL, path: /administration/schemas/sys/objects/views/tables/select.sql

Showing tables of another database

In order to see the tables of another database, sys.schema needs to be qualified with the name of the database:
select
   …
from
   DATABASENAME.sys.tables;

See also

table
The sys schema.

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...', 1737520173, '3.135.209.20', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/administration/schemas/sys/tables/index(66): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78