Table of Contents

Class ObjectSchema.ComputedColumn

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

sys.computed_columns (Transact-SQL)

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

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


See sys.computed_columns.

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

Properties

CollationName

collation_name NULL sysname

Name of the collation of the column if character-based; otherwise NULL.
[Column("collation_name")]
[Nullable]
public string? CollationName { get; set; }

Property Value

string

ColumnEncryptionKeyDatabaseName

column_encryption_key_database_name NULL sysname

The name of the database where the column encryption key exists if different than the database of the column. NULL if the key exists in the same database as the column.

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("column_encryption_key_database_name")]
[Nullable]
public string? ColumnEncryptionKeyDatabaseName { get; set; }

Property Value

string

ColumnEncryptionKeyID

column_encryption_key_id NULL int

ID of the column encryption key (CEK).

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("column_encryption_key_id")]
[Nullable]
public int? ColumnEncryptionKeyID { get; set; }

Property Value

int?

ColumnID

column_id NOT NULL int

ID of the column. Is unique within the object. Column IDs might not be sequential.
[Column("column_id")]
[NotNull]
public int ColumnID { get; set; }

Property Value

int

DefaultObjectID

default_object_id NOT NULL int

ID of the default object, regardless of whether it's a stand-alone object sp_bindefault, or an inline, column-level DEFAULT constraint. The parent_object_id column of an inline column-level default object is a reference back to the table itself.

0 = No default
[Column("default_object_id")]
[NotNull]
public int DefaultObjectID { get; set; }

Property Value

int

Definition

definition NULL nvarchar(max)

SQL text that defines this computed-column.
[Column("definition")]
[Nullable]
public string? Definition { get; set; }

Property Value

string

EncryptionAlgorithmName

encryption_algorithm_name NULL sysname

Name of encryption algorithm. Only AEAD_AES_256_CBC_HMAC_SHA_512 is supported.

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("encryption_algorithm_name")]
[Nullable]
public string? EncryptionAlgorithmName { get; set; }

Property Value

string

EncryptionType

encryption_type NULL int

Encryption type:

1 = Deterministic encryption
2 = Randomized encryption

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("encryption_type")]
[Nullable]
public int? EncryptionType { get; set; }

Property Value

int?

EncryptionTypeDesc

encryption_type_desc NULL nvarchar(64)

Encryption type description:

RANDOMIZED
DETERMINISTIC

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("encryption_type_desc")]
[Nullable]
public string? EncryptionTypeDesc { get; set; }

Property Value

string

GeneratedAlwaysType

generated_always_type NULL tinyint

Identifies when the column value is generated (is always 0 for columns in system tables).

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database.

0 = NOT_APPLICABLE
1 = AS_ROW_START
2 = AS_ROW_END

Applies to: SQL Server 2022 (16.x) and later versions, and SQL Database.

5 = AS_TRANSACTION_ID_START
6 = AS_TRANSACTION_ID_END
7 = AS_SEQUENCE_NUMBER_START
8 = AS_SEQUENCE_NUMBER_END

For more information, see Temporal Tables (Relational databases).
[Column("generated_always_type")]
[Nullable]
public byte? GeneratedAlwaysType { get; set; }

Property Value

byte?

GeneratedAlwaysTypeDesc

generated_always_type_desc NULL nvarchar(60)

Textual description of the generated_always_type value (always NOT_APPLICABLE for columns in system tables)

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database.

NOT_APPLICABLE
AS_ROW_START
AS_ROW_END

Applies to: SQL Server 2022 (16.x) and later versions, and SQL Database.

AS_TRANSACTION_ID_START
AS_TRANSACTION_ID_END
AS_SEQUENCE_NUMBER_START
AS_SEQUENCE_NUMBER_END
[Column("generated_always_type_desc")]
[Nullable]
public string? GeneratedAlwaysTypeDesc { get; set; }

Property Value

string

GraphType

graph_type NULL int

Internal column with a set of values. The values are between 1 and 8 for graph columns, and NULL for others.
[Column("graph_type")]
[Nullable]
public int? GraphType { get; set; }

Property Value

int?

GraphTypeDesc

graph_type_desc NULL nvarchar(60)

Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
[Column("graph_type_desc")]
[Nullable]
public string? GraphTypeDesc { get; set; }

Property Value

string

IsAnsiPadded

is_ansi_padded NOT NULL bit

1 = Column uses ANSI_PADDING ON behavior if character, binary, or variant

0 = Column isn't character, binary, or variant
[Column("is_ansi_padded")]
[NotNull]
public bool IsAnsiPadded { get; set; }

Property Value

bool

IsColumnSet

is_column_set NOT NULL bit

1 = Column is a column set. For more information, see Use sparse columns.
[Column("is_column_set")]
[NotNull]
public bool IsColumnSet { get; set; }

Property Value

bool

IsComputed

is_computed NULL bit

1 = Column is a computed column
[Column("is_computed")]
[Nullable]
public bool? IsComputed { get; set; }

Property Value

bool?

IsDataDeletionFilterColumn

is_data_deletion_filter_column NULL bit

Indicates if the column is the data retention filter column for the table.

Applies to: Azure SQL Edge
[Column("is_data_deletion_filter_column")]
[Nullable]
public bool? IsDataDeletionFilterColumn { get; set; }

Property Value

bool?

IsDroppedLedgerColumn

is_dropped_ledger_column NULL bit

Indicates a ledger table column that was dropped.

Applies to: SQL Server 2022 (16.x) and later versions, and SQL Database
[Column("is_dropped_ledger_column")]
[Nullable]
public bool? IsDroppedLedgerColumn { get; set; }

Property Value

bool?

IsDtsReplicated

is_dts_replicated NULL bit

1 = Column is replicated by using SSIS
[Column("is_dts_replicated")]
[Nullable]
public bool? IsDtsReplicated { get; set; }

Property Value

bool?

IsFilestream

is_filestream NOT NULL bit

1 = Column is a FILESTREAM column
[Column("is_filestream")]
[NotNull]
public bool IsFilestream { get; set; }

Property Value

bool

IsHidden

is_hidden NOT NULL bit

Indicates if the column is hidden:

0 = regular, not-hidden, visible column
1 = hidden column

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("is_hidden")]
[NotNull]
public bool IsHidden { get; set; }

Property Value

bool

IsIdentity

is_identity NOT NULL bit

1 = Column has identity values
[Column("is_identity")]
[NotNull]
public bool IsIdentity { get; set; }

Property Value

bool

IsMasked

is_masked NOT NULL bit

Indicates if the column is masked by dynamic data masking:

0 = regular, not-masked column
1 = column is masked

Applies to: SQL Server 2016 (13.x) and later versions, and SQL Database
[Column("is_masked")]
[NotNull]
public bool IsMasked { get; set; }

Property Value

bool

IsMergePublished

is_merge_published NULL bit

1 = Column is merge-published
[Column("is_merge_published")]
[Nullable]
public bool? IsMergePublished { get; set; }

Property Value

bool?

IsNonSqlSubscribed

is_non_sql_subscribed NULL bit

1 = Column has a non-SQL Server subscriber
[Column("is_non_sql_subscribed")]
[Nullable]
public bool? IsNonSqlSubscribed { get; set; }

Property Value

bool?

IsNullable

is_nullable NULL bit

1 = Column is nullable
0 = Column isn't nullable
[Column("is_nullable")]
[Nullable]
public bool? IsNullable { get; set; }

Property Value

bool?

IsPersisted

is_persisted NOT NULL bit

Computed column is persisted.
[Column("is_persisted")]
[NotNull]
public bool IsPersisted { get; set; }

Property Value

bool

IsReplicated

is_replicated NULL bit

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

Property Value

bool?

IsRowGuidCol

is_rowguidcol NOT NULL bit

1 = Column is a declared ROWGUIDCOL
[Column("is_rowguidcol")]
[NotNull]
public bool IsRowGuidCol { get; set; }

Property Value

bool

IsSparse

is_sparse NOT NULL bit

1 = Column is a sparse column. For more information, see Use sparse columns.
[Column("is_sparse")]
[NotNull]
public bool IsSparse { get; set; }

Property Value

bool

IsXmlDocument

is_xml_document NOT NULL bit

1 = Content is a complete XML document

0 = Content is a document fragment, or the column data type isn't xml
[Column("is_xml_document")]
[NotNull]
public bool IsXmlDocument { get; set; }

Property Value

bool

LedgerViewColumnType

ledger_view_column_type NULL int

If not NULL, indicates the type of a column in a ledger view:

1 = TRANSACTION_ID
2 = SEQUENCE_NUMBER
3 = OPERATION_TYPE
4 = OPERATION_TYPE_DESC

For more information, see Ledger overview.

Applies to: SQL Server 2022 (16.x) and later versions, and SQL Database
[Column("ledger_view_column_type")]
[Nullable]
public int? LedgerViewColumnType { get; set; }

Property Value

int?

LedgerViewColumnTypeDesc

ledger_view_column_type_desc NULL nvarchar(60)

If not NULL, contains a textual description of the the type of a column in a ledger view:

TRANSACTION_ID
SEQUENCE_NUMBER
OPERATION_TYPE
OPERATION_TYPE_DESC

Applies to: SQL Server 2022 (16.x) and later versions, and SQL Database
[Column("ledger_view_column_type_desc")]
[Nullable]
public string? LedgerViewColumnTypeDesc { get; set; }

Property Value

string

MaxLength

max_length NOT NULL smallint

Maximum length (in bytes) of the column.

-1 = Column data type is varchar(max), nvarchar(max), varbinary(max), or xml.

For text, ntext, and image columns, the max_length value is 16 (representing the 16-byte pointer only) or the value set by sp_tableoption 'text in row'.
[Column("max_length")]
[NotNull]
public short MaxLength { get; set; }

Property Value

short

Name

name NULL sysname

Name of the column. Is unique within the object.
[Column("name")]
[Nullable]
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

ID of the object to which this column belongs.
[Column("object_id")]
[NotNull]
public int ObjectID { get; set; }

Property Value

int

Precision

precision NOT NULL tinyint

Precision of the column if numeric-based; otherwise, 0.
[Column("precision")]
[NotNull]
public byte Precision { get; set; }

Property Value

byte

RuleObjectID

rule_object_id NOT NULL int

ID of the stand-alone rule bound to the column by using sys.sp_bindrule.

0 = No stand-alone rule. For column-level CHECK constraints, see sys.check_constraints.
[Column("rule_object_id")]
[NotNull]
public int RuleObjectID { get; set; }

Property Value

int

Scale

scale NOT NULL tinyint

Scale of column if numeric-based; otherwise, 0.
[Column("scale")]
[NotNull]
public byte Scale { get; set; }

Property Value

byte

SystemTypeID

system_type_id NOT NULL tinyint

ID of the system type of the column.
[Column("system_type_id")]
[NotNull]
public byte SystemTypeID { get; set; }

Property Value

byte

UserTypeID

user_type_id NOT NULL int

ID of the type of the column as defined by the user. To return the name of the type, join to the sys.types catalog view on this column.
[Column("user_type_id")]
[NotNull]
public int UserTypeID { get; set; }

Property Value

int

UsesDatabaseCollation

uses_database_collation NOT NULL bit

1 = The column definition depends on the default collation of the database for correct evaluation; otherwise, 0. Such a dependency prevents changing the database default collation.
[Column("uses_database_collation")]
[NotNull]
public bool UsesDatabaseCollation { get; set; }

Property Value

bool

XmlCollectionID

xml_collection_id NOT NULL int

Nonzero if the data type of the column is xml and the XML is typed. The value is the ID of the collection containing the validating XML schema namespace of the column

0 = No XML schema collection
[Column("xml_collection_id")]
[NotNull]
public int XmlCollectionID { get; set; }

Property Value

int