Table of Contents

Class ObjectSchema.View

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.views (Transact-SQL)

Applies to:SQL ServerAzure SQL DatabaseAzure SQL Managed InstanceAzure Synapse AnalyticsAnalytics Platform System (PDW)

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


See sys.views.

[Table(Schema = "sys", Name = "views", IsView = true)]
public class ObjectSchema.View
Inheritance
ObjectSchema.View
Inherited Members
Extension Methods

Properties

CreateDate

create_date NOT NULL datetime

Date the object was created.
[Column("create_date")]
[NotNull]
public DateTime CreateDate { get; set; }

Property Value

DateTime

HasOpaqueMetadata

has_opaque_metadata NOT NULL bit

1 = VIEW_METADATA option specified for view. For more information, see CREATE VIEW (Transact-SQL).
[Column("has_opaque_metadata")]
[NotNull]
public bool HasOpaqueMetadata { get; set; }

Property Value

bool

HasReplicationFilter

has_replication_filter NULL bit

1 = View has a replication filter.
[Column("has_replication_filter")]
[Nullable]
public bool? HasReplicationFilter { get; set; }

Property Value

bool?

HasUncheckedAssemblyData

has_unchecked_assembly_data NOT NULL bit

1 = View contains persisted data that depends on an assembly whose definition changed during the last ALTER ASSEMBLY. Resets to 0 after the next successful DBCC CHECKDB or DBCC CHECKTABLE.
[Column("has_unchecked_assembly_data")]
[NotNull]
public bool HasUncheckedAssemblyData { get; set; }

Property Value

bool

IsDateCorrelationView

is_date_correlation_view NOT NULL bit

1 = View was created automatically by the system to store correlation information between datetime columns. Creation of this view was enabled by setting DATE_CORRELATION_OPTIMIZATION to ON.
[Column("is_date_correlation_view")]
[NotNull]
public bool IsDateCorrelationView { get; set; }

Property Value

bool

IsDroppedLedgerView

is_dropped_ledger_view NULL bit

Applies to: Starting with SQL Server 2022 (16.x), Azure SQL Database.

Indicates a ledger view that has been dropped.
[Column("is_dropped_ledger_view")]
[Nullable]
public bool? IsDroppedLedgerView { get; set; }

Property Value

bool?

IsMSShipped

is_ms_shipped NOT NULL bit

Object is created by an internal SQL Server component.
[Column("is_ms_shipped")]
[NotNull]
public bool IsMSShipped { get; set; }

Property Value

bool

IsPublished

is_published NOT NULL bit

Object is published.
[Column("is_published")]
[NotNull]
public bool IsPublished { get; set; }

Property Value

bool

IsReplicated

is_replicated NULL bit

1 = View is replicated.
[Column("is_replicated")]
[Nullable]
public bool? IsReplicated { get; set; }

Property Value

bool?

IsSchemaPublished

is_schema_published NOT NULL bit

Only the schema of the object is published.
[Column("is_schema_published")]
[NotNull]
public bool IsSchemaPublished { get; set; }

Property Value

bool

LedgerViewType

ledger_view_type NULL tinyint

Applies to: Starting with SQL Server 2022 (16.x), Azure SQL Database.

The numeric value indicating if a view is a ledger view for an updatable ledger table.

0 = NON_LEDGER_VIEW
1 = LEDGER_VIEW

For more information on database ledger, see Ledger.
[Column("ledger_view_type")]
[Nullable]
public byte? LedgerViewType { get; set; }

Property Value

byte?

LedgerViewTypeDesc

ledger_view_type_desc NULL nvarchar(60)

Applies to: Starting with SQL Server 2022 (16.x), Azure SQL Database.

The text description of a value in the ledger_view_type column:

NON_LEDGER_VIEW
LEDGER_VIEW
[Column("ledger_view_type_desc")]
[Nullable]
public string? LedgerViewTypeDesc { get; set; }

Property Value

string

ModifyDate

modify_date NOT NULL datetime

Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when an index on the table or view is created or altered.
[Column("modify_date")]
[NotNull]
public DateTime ModifyDate { get; set; }

Property Value

DateTime

Name

name NOT NULL sysname

Object name.
[Column("name")]
[NotNull]
public string Name { get; set; }

Property Value

string

Object

objects (sys.objects)

[Association(ThisKey = "ObjectID", OtherKey = "ObjectID", CanBeNull = false)]
public ObjectSchema.Object Object { get; set; }

Property Value

ObjectSchema.Object

ObjectID

object_id NOT NULL int

Object identification number. Is unique within a database.
[Column("object_id")]
[NotNull]
public int ObjectID { get; set; }

Property Value

int

ParentObjectID

parent_object_id NOT NULL int

ID of the object to which this object belongs.

0 = Not a child object.
[Column("parent_object_id")]
[NotNull]
public int ParentObjectID { get; set; }

Property Value

int

PrincipalID

principal_id NULL int

ID of the individual owner, if different from the schema owner. By default, schema-contained objects are owned by the schema owner. However, an alternate owner can be specified by using the ALTER AUTHORIZATION statement to change ownership.

NULL if there's no alternate individual owner.

Is NULL if the object type is one of the following values:

C = Check constraint
D = Default (constraint or stand-alone)
F = Foreign key constraint
PK = Primary key constraint
R = Rule (old-style, stand-alone)
TA = Assembly (CLR-integration) trigger
TR = SQL trigger
UQ = Unique constraint
EC = Edge constraint
[Column("principal_id")]
[Nullable]
public int? PrincipalID { get; set; }

Property Value

int?

SchemaID

schema_id NOT NULL int

ID of the schema that the object is contained in.

Schema-scoped system objects are always contained in the sys or INFORMATION_SCHEMA schemas.
[Column("schema_id")]
[NotNull]
public int SchemaID { get; set; }

Property Value

int

Type

type NULL char(2)

Object type:

AF = Aggregate function (CLR)
C = Check constraint
D = Default (constraint or stand-alone)
F = Foreign key constraint
FN = SQL scalar function
FS = Assembly (CLR) scalar-function
FT = Assembly (CLR) table-valued function
IF = SQL inline table-valued function (TVF)
IT = Internal table
P = SQL stored procedure
PC = Assembly (CLR) stored-procedure
PG = Plan guide
PK = Primary key constraint
R = Rule (old-style, stand-alone)
RF = Replication-filter-procedure
S = System base table
SN = Synonym
SO = Sequence object
U = Table (user-defined)
V = View

Applies to: SQL Server 2012 (11.x) and later versions

SQ = Service queue
TA = Assembly (CLR) DML trigger
TF = SQL table-valued-function (TVF)
TR = SQL DML trigger
TT = Table type
UQ = unique constraint
X = Extended stored procedure

Applies to: SQL Server 2014 (12.x) and later versions, Azure SQL Database, Azure Synapse Analytics, Analytics Platform System (PDW)

ST = Statistics tree

Applies to: SQL Server 2016 (13.x) and later versions, Azure SQL Database, Azure Synapse Analytics, Analytics Platform System (PDW)

ET = External table

Applies to: SQL Server 2017 (14.x) and later versions, Azure SQL Database, Azure Synapse Analytics, Analytics Platform System (PDW)

EC = Edge constraint
[Column("type")]
[Nullable]
public string? Type { get; set; }

Property Value

string

TypeDesc

type_desc NULL nvarchar(60)

Description of the object type:

AGGREGATE_FUNCTION
CHECK_CONSTRAINT
CLR_SCALAR_FUNCTION
CLR_STORED_PROCEDURE
CLR_TABLE_VALUED_FUNCTION
CLR_TRIGGER
DEFAULT_CONSTRAINT
EDGE_CONSTRAINT
EXTENDED_STORED_PROCEDURE
FOREIGN_KEY_CONSTRAINT
INTERNAL_TABLE
PLAN_GUIDE
PRIMARY_KEY_CONSTRAINT
REPLICATION_FILTER_PROCEDURE
RULE
SEQUENCE_OBJECT
SERVICE_QUEUE
SQL_INLINE_TABLE_VALUED_FUNCTION
SQL_SCALAR_FUNCTION
SQL_STORED_PROCEDURE
SQL_TABLE_VALUED_FUNCTION
SQL_TRIGGER
SYNONYM
SYSTEM_TABLE
TYPE_TABLE
UNIQUE_CONSTRAINT
USER_TABLE
VIEW
[Column("type_desc")]
[Nullable]
public string? TypeDesc { get; set; }

Property Value

string

WithCheckOption

with_check_option NOT NULL bit

1 = WITH CHECK OPTION was specified in the view definition.
[Column("with_check_option")]
[NotNull]
public bool WithCheckOption { get; set; }

Property Value

bool