Table of Contents

Class ObjectSchema.IndexColumn

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

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.

[Table(Schema = "sys", Name = "index_columns", IsView = true)]
public class ObjectSchema.IndexColumn
Inheritance
ObjectSchema.IndexColumn
Extension Methods

Properties

ColumnID

ID of the column in object_id.

0 = Row Identifier (RID) in a nonclustered index.

column_id is unique only within object_id.

[Column("column_id")]
[NotNull]
public int ColumnID { get; set; }

Property Value

int

ColumnStoreOrderOrdinal

Ordinal (1-based) within set of order columns in an ordered clustered columnstore index.

[Column("column_store_order_ordinal")]
[NotNull]
public byte ColumnStoreOrderOrdinal { get; set; }

Property Value

byte

IndexColumnID

ID of the index column. index_column_id is unique only within index_id.

[Column("index_column_id")]
[NotNull]
public int IndexColumnID { get; set; }

Property Value

int

IndexID

ID of the index in which the column is defined.

[Column("index_id")]
[NotNull]
public int IndexID { get; set; }

Property Value

int

IsDescendingKey

1 = Index key column has a descending sort direction.

0 = Index key column has an ascending sort direction, or the column is part of a columnstore or hash index.

[Column("is_descending_key")]
[Nullable]
public bool? IsDescendingKey { get; set; }

Property Value

bool?

IsIncludedColumn

1 = Column is a nonkey column added to the index by using the CREATE INDEX INCLUDE clause, or the column is part of a columnstore index.

0 = Column is not an included column.

Columns implicitly added because they are part of the clustering key are not listed in sys.index_columns.

Columns implicitly added because they are a partitioning column are returned as 0.

[Column("is_included_column")]
[Nullable]
public bool? IsIncludedColumn { get; set; }

Property Value

bool?

KeyOrdinal

Ordinal (1-based) within set of key-columns.

0 = Not a key column, or is an XML index, a columnstore index, or a spatial index.

Note: An XML or spatial index cannot be a key because the underlying columns are not comparable, meaning that their values cannot be ordered.

[Column("key_ordinal")]
[NotNull]
public byte KeyOrdinal { get; set; }

Property Value

byte

Object

objects (sys.objects)

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

Property Value

ObjectSchema.Object

ObjectID

ID of the object the index is defined on.

[Column("object_id")]
[NotNull]
public int ObjectID { get; set; }

Property Value

int

PartitionOrdinal

Ordinal (1-based) within set of partitioning columns. A clustered columnstore index can have at most 1 partitioning column.

0 = Not a partitioning column.

[Column("partition_ordinal")]
[NotNull]
public byte PartitionOrdinal { get; set; }

Property Value

byte