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
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
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
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
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
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
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
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'.
public ITable<ObjectSchema.CheckConstraint> CheckConstraints { get; }
Property Value
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.
public ITable<ObjectSchema.ColumnStoreDictionary> ColumnStoreDictionaries { get; }
Property Value
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.
public ITable<ObjectSchema.ColumnStoreRowGroup> ColumnStoreRowGroups { get; }
Property Value
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.
public ITable<ObjectSchema.ColumnStoreSegment> ColumnStoreSegments { get; }
Property Value
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
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
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.
public ITable<ObjectSchema.DefaultConstraint> DefaultConstraints { get; }
Property Value
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.
public ITable<ObjectSchema.EventNotificationEventType> EventNotificationEventTypes { get; }
Property Value
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.
public ITable<ObjectSchema.EventNotification> EventNotifications { get; }
Property Value
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
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.
public ITable<ObjectSchema.ExtendedProcedure> ExtendedProcedures { get; }
Property Value
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
public ITable<ObjectSchema.ExternalLanguageFile> ExternalLanguageFiles { get; }
Property Value
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.
public ITable<ObjectSchema.ExternalLanguage> ExternalLanguages { get; }
Property Value
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.
public ITable<ObjectSchema.ExternalLibrary> ExternalLibraries { get; }
Property Value
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.
public ITable<ObjectSchema.ExternalLibraryFile> ExternalLibraryFiles { get; }
Property Value
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.
public ITable<ObjectSchema.ForeignKeyColumn> ForeignKeyColumns { get; }
Property Value
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
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.
public ITable<ObjectSchema.FunctionOrderColumn> FunctionOrderColumns { get; }
Property Value
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
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
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
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
public ITable<ObjectSchema.IndexResumableOperation> IndexResumableOperations { get; }
Property Value
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
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.
public ITable<ObjectSchema.InternalPartition> InternalPartitions { get; }
Property Value
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
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
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
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.
public ITable<ObjectSchema.MemoryOptimizedTablesInternalAttribute> MemoryOptimizedTablesInternalAttributes { get; }
Property Value
ModuleAssemblyUsages
sys.module_assembly_usages (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Returns a row for each module-to-assembly reference.
public ITable<ObjectSchema.ModuleAssemblyUsage> ModuleAssemblyUsages { get; }
Property Value
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.
public ITable<ObjectSchema.NumberedProcedureParameter> NumberedProcedureParameters { get; }
Property Value
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.
public ITable<ObjectSchema.NumberedProcedure> NumberedProcedures { get; }
Property Value
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
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
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
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
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
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
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
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.
public ITable<ObjectSchema.ServerAssemblyModule> ServerAssemblyModules { get; }
Property Value
ServerEventNotifications
sys.server_event_notifications (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Returns a row for each server-level event notification object.
public ITable<ObjectSchema.ServerEventNotification> ServerEventNotifications { get; }
Property Value
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
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.
public ITable<ObjectSchema.ServerSqlModule> ServerSqlModules { get; }
Property Value
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.
public ITable<ObjectSchema.ServerTriggerEvent> ServerTriggerEvents { get; }
Property Value
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
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
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.
public ITable<ObjectSchema.SqlExpressionDependency> SqlExpressionDependencies { get; }
Property Value
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
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
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
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
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
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
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.
public ITable<ObjectSchema.SystemParameter> SystemParameters { get; }
Property Value
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.
public ITable<ObjectSchema.SystemSqlModule> SystemSqlModules { get; }
Property Value
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
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
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
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.
public ITable<ObjectSchema.TriggerEventType> TriggerEventTypes { get; }
Property Value
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
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
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; }