reference.RepoObjectColumn_reference_virtual - V

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

RepoObject_guid: 4777342A-21A5-EB11-84FA-A81E8446D5B0

Description

Examples

Entity Diagram

entity-reference.repoobjectcolumn_reference_virtual

Columns

Table 1. Columns of reference.RepoObjectColumn_reference_virtual - V
PK Column Name Data Type NULL? ID

nvarchar(max)

NULL

varchar(34)

NOT NULL

bit

NULL

bit

NULL

bit

NULL

nvarchar(128)

NOT NULL

nvarchar(128)

NOT NULL

int

NULL

int

NULL

bigint

NULL

uniqueidentifier

NOT NULL

uniqueidentifier

NOT NULL

nvarchar(128)

NOT NULL

char(2)

NULL

nvarchar(128)

NOT NULL

nvarchar(128)

NOT NULL

int

NULL

int

NULL

bigint

NULL

uniqueidentifier

NOT NULL

uniqueidentifier

NOT NULL

nvarchar(128)

NOT NULL

char(2)

NULL

Foreign Key Diagram

entity_1_1_fk-reference.repoobjectcolumn_reference_virtual

References

Object Reference Diagram - 1 1

entity_1_1_objectref-reference.repoobjectcolumn_reference_virtual

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-reference.repoobjectcolumn_reference_virtual

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-reference.repoobjectcolumn_reference_virtual

Column Reference Diagram

entity_1_1_colref-reference.repoobjectcolumn_reference_virtual

Indexes

idx_RepoObjectColumn_reference_virtual__1

idx_RepoObjectColumn_reference_virtual__2

idx_RepoObjectColumn_reference_virtual__3

idx_RepoObjectColumn_reference_virtual__4

idx_RepoObjectColumn_reference_virtual__5

idx_RepoObjectColumn_reference_virtual__6

idx_RepoObjectColumn_reference_virtual__7

idx_RepoObjectColumn_reference_virtual__8

Column Details

_

definition

definition

nvarchar(max)

NULL

InformationSource

InformationSource

varchar(34)

NOT NULL

is_computed

is_computed

bit

NULL

is_referenced_object

is_referenced_object

bit

NULL

is_referencing_object_equal_referenced_object

is_referencing_object_equal_referenced_object

bit

NULL

referenced_column_name

referenced_column_name

nvarchar(128)

NOT NULL

referenced_entity_name

referenced_entity_name

nvarchar(128)

NOT NULL

referenced_id

referenced_id

int

NULL

referenced_minor_id

referenced_minor_id

int

NULL

referenced_node_id

referenced_node_id

bigint

NULL

Description

(CONVERT([bigint],[SysObject_id])*(10000))


referenced_RepoObject_guid

referenced_RepoObject_guid

uniqueidentifier

NOT NULL

referenced_RepoObjectColumn_guid

referenced_RepoObjectColumn_guid

uniqueidentifier

NOT NULL

referenced_schema_name

referenced_schema_name

nvarchar(128)

NOT NULL

referenced_type

referenced_type

char(2)

NULL

referencing_column_name

referencing_column_name

nvarchar(128)

NOT NULL

referencing_entity_name

referencing_entity_name

nvarchar(128)

NOT NULL

referencing_id

referencing_id

int

NULL

referencing_minor_id

referencing_minor_id

int

NULL

referencing_node_id

referencing_node_id

bigint

NULL

Description

(CONVERT([bigint],[SysObject_id])*(10000))


referencing_RepoObject_guid

referencing_RepoObject_guid

uniqueidentifier

NOT NULL

referencing_RepoObjectColumn_guid

referencing_RepoObjectColumn_guid

uniqueidentifier

NOT NULL

referencing_schema_name

referencing_schema_name

nvarchar(128)

NOT NULL

referencing_type

referencing_type

char(2)

NULL

sql_modules_definition

reference.RepoObjectColumn_reference_virtual - V script
CREATE View [reference].[RepoObjectColumn_reference_virtual]
As
--
Select
    referencing_id                                = roc.SysObject_id
  , referencing_minor_id                          = roc.SysObjectColumn_column_id
  , referencing_node_id                           = roc.node_id
  , referenced_id                                 = roc2.SysObject_id
  , referenced_minor_id                           = roc2.SysObjectColumn_column_id
  , referenced_node_id                            = roc2.node_id
  , referencing_RepoObject_guid                   = roc.RepoObject_guid
  , referencing_RepoObjectColumn_guid             = roc.RepoObjectColumn_guid
  , referenced_RepoObject_guid                    = roc2.RepoObject_guid
  , referenced_RepoObjectColumn_guid              = roc2.RepoObjectColumn_guid
  , referencing_type                              = roc.SysObject_type
  , referencing_schema_name                       = roc.SysObject_schema_name
  , referencing_entity_name                       = roc.SysObject_name
  , referencing_column_name                       = roc.SysObjectColumn_name
  , referenced_schema_name                        = roc.SysObject_schema_name
  , referenced_entity_name                        = roc.SysObject_name
  , referenced_column_name                        = roc2.SysObjectColumn_name
  , referenced_type                               = roc2.SysObject_type
  , InformationSource                             = 'reference.RepoObjectSource_virtual'
  , is_referencing_object_equal_referenced_object = Cast(Case
                                                             When roc.RepoObject_guid = roc2.RepoObject_guid
                                                                 Then
                                                                 1
                                                             Else
                                                                 0
                                                         End As Bit)
  --Flag, if the [referenced_RepoObject_guid] is a referenced object in [repo].[RepoObject_reference__union]
  , is_referenced_object                          =
    (
        Select
            Top 1
            Cast(1 As Bit)
        From
            reference.RepoObject_reference_T As ro_r
        Where
            ro_r.referencing_RepoObject_guid    = roc.RepoObject_guid
            And ro_r.referenced_RepoObject_guid = roc2.RepoObject_guid
    )
  --, ros.is_hidden
  , is_computed                                   = Cast(Null As Bit)
  , definition                                    = Cast(Null As NVarchar(Max))
From
    reference.RepoObjectColumnSource_virtual As ros
    Inner Join
        repo.RepoObjectColumn_gross          As roc
            On
            ros.RepoObjectColumn_guid        = roc.RepoObjectColumn_guid

    Inner Join
        repo.RepoObjectColumn_gross          As roc2
            On
            ros.Source_RepoObjectColumn_guid = roc2.RepoObjectColumn_guid