Table of Contents

Class InformationSchema.KeyColumnUsage

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

KEY_COLUMN_USAGE (Transact-SQL)

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

Returns one row for each column that is constrained as a key in the current database. This information schema view returns information about the objects to which the current user has permissions.
To retrieve information from these views, specify the fully qualified name of INFORMATION_SCHEMA._view_name_.


See INFORMATION_SCHEMA.KEY_COLUMN_USAGE.

[Table(Schema = "INFORMATION_SCHEMA", Name = "KEY_COLUMN_USAGE", IsView = true)]
public class InformationSchema.KeyColumnUsage
Inheritance
InformationSchema.KeyColumnUsage
Extension Methods

Properties

ColumnName

Column name.

[Column("COLUMN_NAME")]
[Nullable]
public string? ColumnName { get; set; }

Property Value

string

ConstraintCatalog

Constraint qualifier.

[Column("CONSTRAINT_CATALOG")]
[Nullable]
public string? ConstraintCatalog { get; set; }

Property Value

string

ConstraintName

Constraint name.

[Column("CONSTRAINT_NAME")]
[NotNull]
public string ConstraintName { get; set; }

Property Value

string

ConstraintSchema

Name of schema that contains the constraint.

Important Do not use INFORMATION_SCHEMA views to determine the schema of an object. INFORMATION_SCHEMA views only represent a subset of the metadata of an object. The only reliable way to find the schema of a object is to query the sys.objects catalog view.

[Column("CONSTRAINT_SCHEMA")]
[Nullable]
public string? ConstraintSchema { get; set; }

Property Value

string

OrdinalPosition

Column ordinal position.

[Column("ORDINAL_POSITION")]
[NotNull]
public int OrdinalPosition { get; set; }

Property Value

int

TableCatalog

Table qualifier.

[Column("TABLE_CATALOG")]
[Nullable]
public string? TableCatalog { get; set; }

Property Value

string

TableName

Table name.

[Column("TABLE_NAME")]
[NotNull]
public string TableName { get; set; }

Property Value

string

TableSchema

Name of schema that contains the table.

Important Do not use INFORMATION_SCHEMA views to determine the schema of an object. INFORMATION_SCHEMA views only represent a subset of the metadata of an object. The only reliable way to find the schema of a object is to query the sys.objects catalog view.

[Column("TABLE_SCHEMA")]
[Nullable]
public string? TableSchema { get; set; }

Property Value

string