Edit

Share via


Object catalog views (Transact-SQL)

Applies to: SQL Server

Object catalog views expose metadata about database objects, their definitions, dependencies, and physical structures. The views in the following sections are grouped by the type of metadata they describe, so you can more easily navigate related concepts.

Object definitions and primary object types

These views identify the logical objects defined in a database and their basic characteristics.

System catalog view Description
sys.objects Central catalog of schema-scoped objects. Use it as the starting point for discovering object type, schema, and status.
sys.tables Metadata specific to user tables, including table-level properties.
sys.views Metadata for views, including whether they're schema-bound or indexed.
sys.procedures Metadata for stored procedures.
sys.numbered_procedures Metadata for numbered stored procedures created with the same base name.
sys.numbered_procedure_parameters Parameter metadata specific to numbered stored procedures.
sys.table_types Metadata for user-defined table types used in parameters and variables.
sys.synonyms Maps synonyms to the objects they reference.
sys.sequences Metadata for sequence objects used to generate numeric values.

Columns, parameters, and data structure

These views describe how data is structured within tables, views, and programmable objects.

System catalog view Description
sys.columns Defines column names, data types, nullability, and other column-level attributes.
sys.computed_columns Describes computed columns and their defining expressions.
sys.identity_columns Identifies columns that generate values automatically and their identity settings.
sys.masked_columns Indicates which columns use dynamic data masking and how masking is applied.
sys.parameters Describes input and output parameters for stored procedures and functions.
sys.function_order_columns Provides metadata for columns involved in ordered set functions.

Constraints and relationships

These views describe rules that enforce data integrity and relationships between tables.

System catalog view Description
sys.check_constraints Defines logical conditions that restrict allowable values in columns.
sys.default_constraints Specifies default values applied when no explicit value is provided.
sys.key_constraints Identifies PRIMARY KEY and UNIQUE constraints.
sys.foreign_keys Describes relationships between parent and referenced tables.
sys.foreign_key_columns Maps the specific columns participating in foreign key relationships.

Indexing, statistics, and storage layout

These views describe how data is indexed, partitioned, and physically stored, and how the query optimizer gathers metadata.

System catalog view Description
sys.index_columns Defines which columns participate in indexes and how they're ordered.
sys.hash_indexes Metadata for hash indexes used by memory-optimized tables.
sys.stats Describes statistics objects used by the query optimizer.
sys.stats_columns Identifies the columns that make up each statistics object.
sys.partitions Describes how tables and indexes are divided into partitions.
sys.allocation_units Exposes storage allocation details used to persist table and index data.

Module definitions and dependencies

These views expose executable object definitions and the dependencies between database objects.

System catalog view Description
sys.sql_modules Stores the Transact-SQL source text for views, procedures, functions, and triggers.
sys.assembly_modules Metadata for CLR-based database objects.
sys.sql_expression_dependencies Tracks dependencies inferred from SQL expressions, used for impact analysis.
sys.sql_dependencies Legacy dependency information retained for backward compatibility.

Triggers, events, and messaging

These views describe event-driven behavior and asynchronous processing infrastructure.

System catalog view Description
sys.triggers Metadata for Data Manipulation Language (DML) and Data Definition Language (DDL) triggers.
sys.trigger_events Identifies which events cause triggers to fire.
sys.trigger_event_types Lists the supported trigger event types.
sys.event_notifications Describes event notifications configured for database or server events.
sys.events Lists event types that can be used with event notifications.
sys.service_queues Metadata for Service Broker queues used for message processing.

Specialized and system-managed metadata

These views expose metadata for features that are engine-managed or feature-specific rather than general-purpose schema elements.

System catalog view Description
sys.periods Defines system-time periods for temporal tables.
sys.memory_optimized_tables_internal_attributes Internal metadata for memory-optimized tables.
sys.extended_procedures Metadata for legacy extended stored procedures.