Table of Contents

Class ObjectSchema.DataContext

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll
public class ObjectSchema.DataContext
Inheritance
ObjectSchema.DataContext
Extension Methods

Constructors

DataContext(IDataContext)

public DataContext(IDataContext dataContext)

Parameters

dataContext IDataContext

Properties

AllColumns

sys.all_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Shows the union of all columns belonging to user-defined objects and system objects.


See sys.all_columns.

public ITable<ObjectSchema.AllColumn> AllColumns { get; }

Property Value

ITable<ObjectSchema.AllColumn>

AllObjects

sys.all_objects (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Shows the UNION of all schema-scoped user-defined objects and system objects.


See sys.all_objects.

public ITable<ObjectSchema.AllObject> AllObjects { get; }

Property Value

ITable<ObjectSchema.AllObject>

AllParameters

sys.all_parameters (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Shows the union of all parameters that belong to user-defined or system objects.


See sys.all_parameters.

public ITable<ObjectSchema.AllParameter> AllParameters { get; }

Property Value

ITable<ObjectSchema.AllParameter>

AllSqlModules

sys.all_sql_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns the union of sys.sql_modules and sys.system_sql_modules.
The view returns a row for each natively compiled, scalar user-defined function. For more information, see Scalar User-Defined Functions for In-Memory OLTP.


See sys.all_sql_modules.

public ITable<ObjectSchema.AllSqlModule> AllSqlModules { get; }

Property Value

ITable<ObjectSchema.AllSqlModule>

AllViews

sys.all_views (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Shows the UNION of all user-defined and system views.


See sys.all_views.

public ITable<ObjectSchema.AllView> AllViews { get; }

Property Value

ITable<ObjectSchema.AllView>

AllocationUnits

sys.allocation_units (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each allocation unit in the database.


See sys.allocation_units.

public ITable<ObjectSchema.AllocationUnit> AllocationUnits { get; }

Property Value

ITable<ObjectSchema.AllocationUnit>

AssemblyModules

sys.assembly_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns one row for each function, procedure or trigger that is defined by a common language runtime (CLR) assembly. This catalog view maps CLR stored procedures, CLR triggers, or CLR functions to their underlying implementation. Objects of type TA, AF, PC, FS, and FT have an associated assembly module. To find the association between the object and the assembly, you can join this catalog view to other catalog views. For example, when you create a CLR stored procedure, it is represented by one row in sys.objects, one row in sys.procedures (which inherits from sys.objects), and one row in sys.assembly_modules. The stored procedure itself is represented by the metadata in sys.objects and sys.procedures. References to the procedure's underlying CLR implementation are found in sys.assembly_modules.


See sys.assembly_modules.

public ITable<ObjectSchema.AssemblyModule> AssemblyModules { get; }

Property Value

ITable<ObjectSchema.AssemblyModule>

CheckConstraints

sys.check_constraints (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each object that is a CHECK constraint, with sys.objects.type = 'C'.


See sys.check_constraints.

public ITable<ObjectSchema.CheckConstraint> CheckConstraints { get; }

Property Value

ITable<ObjectSchema.CheckConstraint>

ColumnStoreDictionaries

sys.column_store_dictionaries (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains a row for each dictionary used in xVelocity memory optimized columnstore indexes. Dictionaries are used to encode some, but not all data types, therefore not all columns in a columnstore index have dictionaries. A dictionary can exist as a primary dictionary (for all segments) and possibly for other secondary dictionaries used for a subset of the column's segments.


See sys.column_store_dictionaries.

public ITable<ObjectSchema.ColumnStoreDictionary> ColumnStoreDictionaries { get; }

Property Value

ITable<ObjectSchema.ColumnStoreDictionary>

ColumnStoreRowGroups

sys.column_store_row_groups (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Provides clustered columnstore index information on a per-segment basis to help the administrator make system management decisions. sys.column_store_row_groups has a column for the total number of rows physically stored (including those marked as deleted) and a column for the number of rows marked as deleted. Use sys.column_store_row_groups to determine which row groups have a high percentage of deleted rows and should be rebuilt.


See sys.column_store_row_groups.

public ITable<ObjectSchema.ColumnStoreRowGroup> ColumnStoreRowGroups { get; }

Property Value

ITable<ObjectSchema.ColumnStoreRowGroup>

ColumnStoreSegments

sys.column_store_segments (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns one row for each column segment in a columnstore index. There is one column segment per column per rowgroup. For example, a table with 10 rowgroups and 34 columns returns 340 rows.


See sys.column_store_segments.

public ITable<ObjectSchema.ColumnStoreSegment> ColumnStoreSegments { get; }

Property Value

ITable<ObjectSchema.ColumnStoreSegment>

Columns

sys.columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns a row for each column of an object that has columns, such as views or tables. The following is a list of object types that have columns:
- Table-valued assembly functions (FT)
- Inline table-valued SQL functions (IF)
- Internal tables (IT)
- System tables (S)
- Table-valued SQL functions (TF)
- User tables (U)
- Views (V)


See sys.columns.

public ITable<ObjectSchema.Column> Columns { get; }

Property Value

ITable<ObjectSchema.Column>

ComputedColumns

sys.computed_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each column found in sys.columns that is a computed-column.


See sys.computed_columns.

public ITable<ObjectSchema.ComputedColumn> ComputedColumns { get; }

Property Value

ITable<ObjectSchema.ComputedColumn>

DefaultConstraints

sys.default_constraints (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each object that is a default definition (created as part of a CREATE TABLE or ALTER TABLE statement instead of a CREATE DEFAULT statement), with sys.objects.type = D.


See sys.default_constraints.

public ITable<ObjectSchema.DefaultConstraint> DefaultConstraints { get; }

Property Value

ITable<ObjectSchema.DefaultConstraint>

EventNotificationEventTypes

sys.event_notification_event_types (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Returns a row for each event or event group on which an event notification can fire.


See sys.event_notification_event_types.

public ITable<ObjectSchema.EventNotificationEventType> EventNotificationEventTypes { get; }

Property Value

ITable<ObjectSchema.EventNotificationEventType>

EventNotifications

sys.event_notifications (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Returns a row for each object that is an event notification, with sys.objects.type = EN.


See sys.event_notifications.

public ITable<ObjectSchema.EventNotification> EventNotifications { get; }

Property Value

ITable<ObjectSchema.EventNotification>

Events

sys.events (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each event for which a trigger or event notification fires. These events represent the event types that are specified when the trigger or event notification is created by using CREATE TRIGGER or CREATE EVENT NOTIFICATION.


See sys.events.

public ITable<ObjectSchema.Event> Events { get; }

Property Value

ITable<ObjectSchema.Event>

ExtendedProcedures

sys.extended_procedures (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains a row for each object that is an extended stored procedure, with sys.objects.type = X. Because extended stored procedures are installed into the master database, they are only visible from that database context. Selecting from the sys.extended_procedures view in any other database context will return an empty result set.


See sys.extended_procedures.

public ITable<ObjectSchema.ExtendedProcedure> ExtendedProcedures { get; }

Property Value

ITable<ObjectSchema.ExtendedProcedure>

ExternalLanguageFiles

sys.external_language_files (Transact-SQL)

Applies to: √ SQL Server 2019 (15.x)

This catalog view provides a list of the external language extension files in the database. R and Python are reserved names and no external language can be created with those specific names.
When an external language is created from a file_spec, the extension itself and its properties are listed in this view. This view will contain one entry per language, per OS.
## sys.external_language_files
The catalog view sys.external_language_files lists a row for each external language extension in the database. Parameters


See sys.external_language_files.

public ITable<ObjectSchema.ExternalLanguageFile> ExternalLanguageFiles { get; }

Property Value

ITable<ObjectSchema.ExternalLanguageFile>

ExternalLanguages

sys.external_languages (Transact-SQL)

Applies to: √ SQL Server 2019 (15.x)

This catalog view provides a list of the external languages in the database. R and Python are reserved names and no external language can be created with those specific names.
## sys.external_languages
The catalog view sys.external_languages lists a row for each external language in the database.


See sys.external_languages.

public ITable<ObjectSchema.ExternalLanguage> ExternalLanguages { get; }

Property Value

ITable<ObjectSchema.ExternalLanguage>

ExternalLibraries

sys.external_libraries (Transact-SQL)

Applies to: √ SQL Server 2017 (14.x) and later √ Azure SQL Managed Instance

Supports the management of package libraries related to external runtimes such as R, Python, and Java.

note


In SQL Server 2017, R language and Windows platform are supported. R, Python, and Java on the Windows and Linux platforms are supported in SQL Server 2019 and later. On Azure SQL Managed Instance, R and Python are supported.


## sys.external_libraries
The catalog view sys.external_libraries lists a row for each external library that has been uploaded into the database.

See sys.external_libraries.

public ITable<ObjectSchema.ExternalLibrary> ExternalLibraries { get; }

Property Value

ITable<ObjectSchema.ExternalLibrary>

ExternalLibraryFiles

sys.external_library_files (Transact-SQL)

Applies to: √ SQL Server 2017 (14.x) and later √ Azure SQL Managed Instance

Lists a row for each file that makes up an external library.


See sys.external_library_files.

public ITable<ObjectSchema.ExternalLibraryFile> ExternalLibraryFiles { get; }

Property Value

ITable<ObjectSchema.ExternalLibraryFile>

ForeignKeyColumns

sys.foreign_key_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each column, or set of columns, that comprise a foreign key.


See sys.foreign_key_columns.

public ITable<ObjectSchema.ForeignKeyColumn> ForeignKeyColumns { get; }

Property Value

ITable<ObjectSchema.ForeignKeyColumn>

ForeignKeys

sys.foreign_keys (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row per object that is a FOREIGN KEY constraint, with sys.object.type = F.


See sys.foreign_keys.

public ITable<ObjectSchema.ForeignKey> ForeignKeys { get; }

Property Value

ITable<ObjectSchema.ForeignKey>

FunctionOrderColumns

sys.function_order_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns one row per column that is a part of an ORDER expression of a common language runtime (CLR) table-valued function.


See sys.function_order_columns.

public ITable<ObjectSchema.FunctionOrderColumn> FunctionOrderColumns { get; }

Property Value

ITable<ObjectSchema.FunctionOrderColumn>

HashIndexes

sys.hash_indexes (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Shows the current hash indexes and the hash index properties. Hash indexes are supported only on In-Memory OLTP (In-Memory Optimization).
The sys.hash_indexes view contains the same columns as the sys.indexes view and an additional column named bucket_count. For more information about the other columns in the sys.hash_indexes view, see sys.indexes (Transact-SQL).


See sys.hash_indexes.

public ITable<ObjectSchema.HashIndex> HashIndexes { get; }

Property Value

ITable<ObjectSchema.HashIndex>

IdentityColumns

sys.identity_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each column that is an identity column.
The sys.identity_columns view inherits rows from the sys.columns view. The sys.identity_columns view returns the columns in the sys.columns view, plus the seed_value, increment_value, last_value, and is_not_for_replication columns. For more information, see Catalog Views (Transact-SQL).


See sys.identity_columns.

public ITable<ObjectSchema.IdentityColumn> IdentityColumns { get; }

Property Value

ITable<ObjectSchema.IdentityColumn>

IndexColumns

sys.index_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains one row per column that is part of a sys.indexes index or unordered table (heap).


See sys.index_columns.

public ITable<ObjectSchema.IndexColumn> IndexColumns { get; }

Property Value

ITable<ObjectSchema.IndexColumn>

IndexResumableOperations

sys.index_resumable_operations (Transact-SQL)

Applies to: √ SQL Server 2017 (14.x) and later √ Azure SQL Database

sys.index_resumable_operations is a system view that monitors and checks the current execution status for resumable Index rebuild or creation.
Applies to: SQL Server (2017 and newer), and Azure SQL Database


See sys.index_resumable_operations.

public ITable<ObjectSchema.IndexResumableOperation> IndexResumableOperations { get; }

Property Value

ITable<ObjectSchema.IndexResumableOperation>

Indexes

sys.indexes (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row per index or heap of a tabular object, such as a table, view, or table-valued function.


See sys.indexes.

public ITable<ObjectSchema.Index> Indexes { get; }

Property Value

ITable<ObjectSchema.Index>

InternalPartitions

sys.internal_partitions (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later √ Azure SQL Database √ Azure SQL Managed Instance

Returns one row for each rowset that tracks internal data for columnstore indexes on disk-based tables. These rowsets are internal to columnstore indexes and track deleted rows, rowgroup mappings, and delta store rowgroups. They track data for each for each table partition; every table has at least one partition. SQL Server re-creates the rowsets each time it rebuilds the columnstore index.


See sys.internal_partitions.

public ITable<ObjectSchema.InternalPartition> InternalPartitions { get; }

Property Value

ITable<ObjectSchema.InternalPartition>

InternalTables

sys.internal_tables (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns one row for each object that is an internal table. Internal tables are automatically generated by SQL Server to support various features. For example, when you create a primary XML index, SQL Server automatically creates an internal table to persist the shredded XML document data. Internal tables appear in the sys schema of every database and have unique, system-generated names that indicate their function, for example, xml_index_nodes_2021582240_32001 or queue_messages_1977058079
Internal tables do not contain user-accessible data, and their schema are fixed and unalterable. You cannot reference internal table names in Transact\-SQL statements. For example, you cannot execute a statement such as SELECT \* FROM *\<sys.internal_table_name>*. However, you can query catalog views to see the metadata of internal tables.


See sys.internal_tables.

public ITable<ObjectSchema.InternalTable> InternalTables { get; }

Property Value

ITable<ObjectSchema.InternalTable>

KeyConstraints

sys.key_constraints (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each object that is a primary key or unique constraint. Includes sys.objects.type PK and UQ.


See sys.key_constraints.

public ITable<ObjectSchema.KeyConstraint> KeyConstraints { get; }

Property Value

ITable<ObjectSchema.KeyConstraint>

MaskedColumns

sys.masked_columns (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later √ Azure SQL Database √ Azure SQL Managed Instance

Use the sys.masked_columns view to query for table-columns that have a dynamic data masking function applied to them. This view inherits from the sys.columns view. It returns all columns in the sys.columns view, plus the is_masked and masking_function columns, indicating if the column is masked, and if so, what masking function is defined. This view only shows the columns on which there is a masking function applied.


See sys.masked_columns.

public ITable<ObjectSchema.MaskedColumn> MaskedColumns { get; }

Property Value

ITable<ObjectSchema.MaskedColumn>

MemoryOptimizedTablesInternalAttributes

sys.memory_optimized_tables_internal_attributes (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later √ Azure SQL Database √ Azure SQL Managed Instance

Contains a row for each internal memory-optimized table used for storing user memory-optimized tables. Each user table corresponds to one or more internal tables. A single table is used for the core data storage. Additional internal tables are used to support features such as temporal, columnstore index and off-row (LOB) storage for memory-optimized tables.


See sys.memory_optimized_tables_internal_attributes.

public ITable<ObjectSchema.MemoryOptimizedTablesInternalAttribute> MemoryOptimizedTablesInternalAttributes { get; }

Property Value

ITable<ObjectSchema.MemoryOptimizedTablesInternalAttribute>

ModuleAssemblyUsages

sys.module_assembly_usages (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns a row for each module-to-assembly reference.


See sys.module_assembly_usages.

public ITable<ObjectSchema.ModuleAssemblyUsage> ModuleAssemblyUsages { get; }

Property Value

ITable<ObjectSchema.ModuleAssemblyUsage>

NumberedProcedureParameters

sys.numbered_procedure_parameters (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains one row for each parameter of a numbered procedure. When you create a numbered stored procedure, the base procedure is number 1. All subsequent procedures have numbers 2, 3, and so forth. sys.numbered_procedure_parameters contains the parameter definitions for all subsequent procedures, numbered 2 and greater. This view does not show parameters for the base stored procedure (number = 1). The base stored procedure is similar to a nonnumbered stored procedure. Therefore, its parameters are represented in sys.parameters (Transact-SQL).

important


Numbered procedures are deprecated. Use of numbered procedures is discouraged. A DEPRECATION_ANNOUNCEMENT event is fired when a query that uses this catalog view is compiled.


note


XML and CLR parameters are not supported for numbered procedures.


See sys.numbered_procedure_parameters.

public ITable<ObjectSchema.NumberedProcedureParameter> NumberedProcedureParameters { get; }

Property Value

ITable<ObjectSchema.NumberedProcedureParameter>

NumberedProcedures

sys.numbered_procedures (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each SQL Server stored procedure that was created as a numbered procedure. This does not show a row for the base (number = 1) stored procedure. Entries for the base stored procedures can be found in views such as sys.objects and sys.procedures.

important


Numbered procedures are deprecated. Use of numbered procedures is discouraged. A DEPRECATION_ANNOUNCEMENT event is fired when a query that uses this catalog view is compiled.


See sys.numbered_procedures.

public ITable<ObjectSchema.NumberedProcedure> NumberedProcedures { get; }

Property Value

ITable<ObjectSchema.NumberedProcedure>

Objects

sys.objects (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each user-defined, schema-scoped object that is created within a database, including natively compiled scalar user-defined function.
For more information, see Scalar User-Defined Functions for In-Memory OLTP.

note


sys.objects does not show DDL triggers, because they are not schema-scoped. All triggers, both DML and DDL, are found in sys.triggers. sys.triggers supports a mixture of name-scoping rules for the various kinds of triggers.


See sys.objects.

public ITable<ObjectSchema.Object> Objects { get; }

Property Value

ITable<ObjectSchema.Object>

Parameters

sys.parameters (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each parameter of an object that accepts parameters. If the object is a scalar function, there is also a single row describing the return value. That row will have a parameter_id value of 0.


See sys.parameters.

public ITable<ObjectSchema.Parameter> Parameters { get; }

Property Value

ITable<ObjectSchema.Parameter>

Partitions

sys.partitions (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each partition of all the tables and most types of indexes in the database. Special index types such as Full-Text, Spatial, and XML are not included in this view. All tables and indexes in SQL Server contain at least one partition, whether or not they are explicitly partitioned.


See sys.partitions.

public ITable<ObjectSchema.Partition> Partitions { get; }

Property Value

ITable<ObjectSchema.Partition>

Periods

sys.periods (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later

Returns a row for each table for which periods have been defined.


See sys.periods.

public ITable<ObjectSchema.Period> Periods { get; }

Property Value

ITable<ObjectSchema.Period>

PlanGuides

sys.plan_guides (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each plan guide in the database.


See sys.plan_guides.

public ITable<ObjectSchema.PlanGuide> PlanGuides { get; }

Property Value

ITable<ObjectSchema.PlanGuide>

Procedures

sys.procedures (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each object that is a procedure of some kind, with sys.objects.type = P, X, RF, and PC.


See sys.procedures.

public ITable<ObjectSchema.Procedure> Procedures { get; }

Property Value

ITable<ObjectSchema.Procedure>

Sequences

sys.sequences (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each sequence object in a database.


See sys.sequences.

public ITable<ObjectSchema.Sequence> Sequences { get; }

Property Value

ITable<ObjectSchema.Sequence>

ServerAssemblyModules

sys.server_assembly_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains one row for each assembly module for the server-level triggers of type TA. This view maps assembly triggers to the underlying CLR implementation. You can join this relation to sys.server_triggers. The assembly must be loaded into the master database. The tuple (object_id) is the key for the relation.


See sys.server_assembly_modules.

public ITable<ObjectSchema.ServerAssemblyModule> ServerAssemblyModules { get; }

Property Value

ITable<ObjectSchema.ServerAssemblyModule>

ServerEventNotifications

sys.server_event_notifications (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns a row for each server-level event notification object.


See sys.server_event_notifications.

public ITable<ObjectSchema.ServerEventNotification> ServerEventNotifications { get; }

Property Value

ITable<ObjectSchema.ServerEventNotification>

ServerEvents

sys.server_events (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains one row for each event for which a server-level event-notification or server-level DDL trigger fires. The columns object_id and type uniquely identify the server event.


See sys.server_events.

public ITable<ObjectSchema.ServerEvent> ServerEvents { get; }

Property Value

ITable<ObjectSchema.ServerEvent>

ServerSqlModules

sys.server_sql_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains the set of SQL modules for server-level triggers of type TR. You can join this relation to sys.server_triggers. The tuple (object_id) is the key of the relation.


See sys.server_sql_modules.

public ITable<ObjectSchema.ServerSqlModule> ServerSqlModules { get; }

Property Value

ITable<ObjectSchema.ServerSqlModule>

ServerTriggerEvents

sys.server_trigger_events (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains one row for each event for which a server-level (synchronous) trigger fires.


See sys.server_trigger_events.

public ITable<ObjectSchema.ServerTriggerEvent> ServerTriggerEvents { get; }

Property Value

ITable<ObjectSchema.ServerTriggerEvent>

ServerTriggers

sys.server_triggers (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains the set of all server-level DDL triggers with object_type of TR or TA. In the case of CLR triggers, the assembly must be loaded into the master database. All server-level DDL trigger names exist in a single, global scope.


See sys.server_triggers.

public ITable<ObjectSchema.ServerTrigger> ServerTriggers { get; }

Property Value

ITable<ObjectSchema.ServerTrigger>

SqlDependencies

sys.sql_dependencies (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains a row for each dependency on a referenced entity as referenced in the Transact\-SQL expression or statements that define some other referencing object.

important


This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use sys.sql_expression_dependencies instead.


See sys.sql_dependencies.

public ITable<ObjectSchema.SqlDependency> SqlDependencies { get; }

Property Value

ITable<ObjectSchema.SqlDependency>

SqlExpressionDependencies

sys.sql_expression_dependencies (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains one row for each by-name dependency on a user-defined entity in the current database. This includes dependences between natively compiled, scalar user-defined functions and other SQL Server modules. A dependency between two entities is created when one entity, called the *referenced entity*, appears by name in a persisted SQL expression of another entity, called the *referencing entity*. For example, when a table is referenced in the definition of a view, the view, as the referencing entity, depends on the table, the referenced entity. If the table is dropped, the view is unusable.
For more information, see Scalar User-Defined Functions for In-Memory OLTP.
You can use this catalog view to report dependency information for the following entities:
- Schema-bound entities.
- Non-schema-bound entities.
- Cross-database and cross-server entities. Entity names are reported; however, entity IDs are not resolved.
- Column-level dependencies on schema-bound entities. Column-level dependencies for non-schema-bound objects can be returned by using sys.dm_sql_referenced_entities.
- Server-level DDL triggers when in the context of the master database.


See sys.sql_expression_dependencies.

public ITable<ObjectSchema.SqlExpressionDependency> SqlExpressionDependencies { get; }

Property Value

ITable<ObjectSchema.SqlExpressionDependency>

SqlModules

sys.sql_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns a row for each object that is an SQL language-defined module in SQL Server, including natively compiled scalar user-defined function. Objects of type P, RF, V, TR, FN, IF, TF, and R have an associated SQL module. Stand-alone defaults, objects of type D, also have an SQL module definition in this view. For a description of these types, see the type column in the sys.objects catalog view.
For more information, see Scalar User-Defined Functions for In-Memory OLTP.


See sys.sql_modules.

public ITable<ObjectSchema.SqlModule> SqlModules { get; }

Property Value

ITable<ObjectSchema.SqlModule>

Stats

sys.stats (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each statistics object that exists for the tables, indexes, and indexed views in the database in SQL Server. Every index will have a corresponding statistics row with the same name and ID (index_id = stats_id), but not every statistics row has a corresponding index.
The catalog view sys.stats_columns provides statistics information for each column in the database. For more information about statistics, see Statistics.


See sys.stats.

public ITable<ObjectSchema.Stat> Stats { get; }

Property Value

ITable<ObjectSchema.Stat>

StatsColumns

sys.stats_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each column that is part of sys.stats statistics.


See sys.stats_columns.

public ITable<ObjectSchema.StatsColumn> StatsColumns { get; }

Property Value

ITable<ObjectSchema.StatsColumn>

Synonyms

sys.synonyms (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each synonym object that is sys.objects.type = SN.


See sys.synonyms.

public ITable<ObjectSchema.Synonym> Synonyms { get; }

Property Value

ITable<ObjectSchema.Synonym>

SystemColumns

sys.system_columns (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each column of system objects that have columns.


See sys.system_columns.

public ITable<ObjectSchema.SystemColumn> SystemColumns { get; }

Property Value

ITable<ObjectSchema.SystemColumn>

SystemObjects

sys.system_objects (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains one row for all schema-scoped system objects that are included with Microsoft SQL Server. All system objects are contained in the schemas named sys or INFORMATION_SCHEMA.


See sys.system_objects.

public ITable<ObjectSchema.SystemObject> SystemObjects { get; }

Property Value

ITable<ObjectSchema.SystemObject>

SystemParameters

sys.system_parameters (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains one row for each system object that has parameters.


See sys.system_parameters.

public ITable<ObjectSchema.SystemParameter> SystemParameters { get; }

Property Value

ITable<ObjectSchema.SystemParameter>

SystemSqlModules

sys.system_sql_modules (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns one row per system object that contains an SQL language-defined module. System objects of type FN, IF, P, PC, TF, V have an associated SQL module. To identify the containing object, you can join this view to sys.system_objects.


See sys.system_sql_modules.

public ITable<ObjectSchema.SystemSqlModule> SystemSqlModules { get; }

Property Value

ITable<ObjectSchema.SystemSqlModule>

SystemViews

sys.system_views (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Contains one row for each system view that is shipped with SQL Server. All system views are contained in the schemas named sys or INFORMATION_SCHEMA.


See sys.system_views.

public ITable<ObjectSchema.SystemView> SystemViews { get; }

Property Value

ITable<ObjectSchema.SystemView>

TableTypes

sys.table_types (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Displays properties of user-defined table types in SQL Server. A table type is a type from which table variables or table-valued parameters could be declared. Each table type has a type_table_object_id that is a foreign key into the sys.objects catalog view. You can use this ID column to query various catalog views, in a way that is similar to an object_id column of a regular table, to discover the structure of the table type such as its columns and constraints.


See sys.table_types.

public ITable<ObjectSchema.TableType> TableTypes { get; }

Property Value

ITable<ObjectSchema.TableType>

Tables

sys.tables (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns a row for each user table in SQL Server.


See sys.tables.

public ITable<ObjectSchema.Table> Tables { get; }

Property Value

ITable<ObjectSchema.Table>

TriggerEventTypes

sys.trigger_event_types (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns a row for each event or event group on which a trigger can fire.


See sys.trigger_event_types.

public ITable<ObjectSchema.TriggerEventType> TriggerEventTypes { get; }

Property Value

ITable<ObjectSchema.TriggerEventType>

TriggerEvents

sys.trigger_events (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row per event for which a trigger fires.

note


sys.trigger_events does not apply to event notifications.


See sys.trigger_events.

public ITable<ObjectSchema.TriggerEvent> TriggerEvents { get; }

Property Value

ITable<ObjectSchema.TriggerEvent>

Triggers

sys.triggers (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database

Contains a row for each object that is a trigger, with a type of TR or TA. DML trigger names are schema-scoped and, therefore, are visible in sys.objects. DDL trigger names are scoped by the parent entity and are only visible in this view.
The parent_class and name columns uniquely identify the trigger in the database.


See sys.triggers.

public ITable<ObjectSchema.Trigger> Triggers { get; }

Property Value

ITable<ObjectSchema.Trigger>

Views

sys.views (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each view object, with sys.objects.type = V.


See sys.views.

public ITable<ObjectSchema.View> Views { get; }

Property Value

ITable<ObjectSchema.View>