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