repo.IndexColumn_union - V

type: V ( view ), modify_date: 2022-01-05 18:06:35

RepoObject_guid: 6790291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo.indexcolumn_union

Columns

Table 1. Columns of repo.IndexColumn_union - V
PK Column Name Data Type NULL? ID

1

uniqueidentifier

NULL

2

int

NOT NULL

int

NULL

nvarchar(450)

NULL

bit

NULL

bit

NULL

bit

NULL

bit

NULL

uniqueidentifier

NULL

nvarchar(128)

NULL

nvarchar(261)

NULL

nvarchar(128)

NULL

uniqueidentifier

NULL

nvarchar(128)

NULL

nvarchar(182)

NULL

Foreign Key Diagram

entity_1_1_fk-repo.indexcolumn_union

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo.indexcolumn_union

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo.indexcolumn_union

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo.indexcolumn_union

Column Reference Diagram

entity_1_1_colref-repo.indexcolumn_union

Indexes

PK_IndexColumn_union

Column Details

_

index_guid

1

index_guid

uniqueidentifier

NULL

index_column_id

2

index_column_id

int

NOT NULL

ColumnsPerIndex

ColumnsPerIndex

int

NULL

index_name

index_name

nvarchar(450)

NULL

is_descending_key

is_descending_key

bit

NULL

is_index_primary_key

is_index_primary_key

bit

NULL

is_index_real

is_index_real

bit

NULL

is_index_unique

is_index_unique

bit

NULL

parent_RepoObject_guid

parent_RepoObject_guid

uniqueidentifier

NULL

parent_schema_name

parent_schema_name

nvarchar(128)

NULL

parent_SysObject_fullname

parent_SysObject_fullname

nvarchar(261)

NULL

parent_SysObject_name

parent_SysObject_name

nvarchar(128)

NULL

RepoObjectColumn_guid

RepoObjectColumn_guid

uniqueidentifier

NULL

SysObject_column_name

SysObject_column_name

nvarchar(128)

NULL

SysObject_column_user_type_fullname

SysObject_column_user_type_fullname

nvarchar(182)

NULL

sql_modules_definition

repo.IndexColumn_union - V script
CREATE View repo.IndexColumn_union
As
Select
    T1.index_guid
  , T1.index_column_id
  , T1.is_descending_key
  , T1.RepoObjectColumn_guid
  , T1.parent_RepoObject_guid
  , T1.index_name
  , T1.parent_schema_name
  , T1.parent_SysObject_name
  , T1.SysObject_column_name
  , T1.SysObject_column_user_type_fullname
  , T1.is_index_unique
  , T1.is_index_primary_key
  , T1.is_index_real
  , T1.parent_SysObject_fullname
  , ColumnsPerIndex = Count ( * ) Over ( Partition By T1.index_guid )
From
    repo_sys.IndexColumn_unique As T1
Where
    Not T1.index_guid Is Null
Union All
Select
    T2.index_guid
  , T2.index_column_id
  , T2.is_descending_key
  , T2.RepoObjectColumn_guid
  , T2.parent_RepoObject_guid
  , T2.index_name
  , T2.parent_schema_name
  , T2.parent_Object_name
  , T2.Object_column_name
  , T2.column_user_type_fullname
  , T2.is_index_unique
  , T2.is_index_primary_key
  , T2.is_index_real
  , T2.parent_Object_fullname
  , ColumnsPerIndex = Count ( * ) Over ( Partition By T2.index_guid )
From
    repo.IndexColumn_virtual_gross As T2
Where
    Not T2.index_guid Is Null
Union All
Select
    T2.index_guid
  , T2.index_column_id
  , T2.is_descending_key
  , T2.RepoObjectColumn_guid
  , T2.parent_RepoObject_guid
  , T2.index_name
  , T2.parent_schema_name
  , T2.parent_Object_name
  , T2.Object_column_name
  , T2.column_user_type_fullname
  , T2.is_index_unique
  , T2.is_index_primary_key
  , T2.is_index_real
  , T2.parent_Object_fullname
  , ColumnsPerIndex = Count ( * ) Over ( Partition By T2.index_guid )
From
    repo.IndexColumn_ssas_gross As T2
Where
    Not T2.index_guid Is Null