reference.RepoObject_ReferencedReferencing - V

type: V ( view ), modify_date: 2021-11-19 17:46:23

RepoObject_guid: 414679B8-147C-EB11-84E6-A81E8446D5B0

Description

Examples

Entity Diagram

entity-reference.repoobject_referencedreferencing

Columns

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

nvarchar(max)

NOT NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

nvarchar(261)

NOT NULL

nvarchar(257)

NOT NULL

uniqueidentifier

NOT NULL

int

NULL

bit

NOT NULL

char(2)

NULL

nvarchar(max)

NOT NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

nvarchar(261)

NOT NULL

nvarchar(257)

NOT NULL

uniqueidentifier

NOT NULL

int

NULL

bit

NOT NULL

varchar(2)

NULL

Foreign Key Diagram

entity_1_1_fk-reference.repoobject_referencedreferencing

References

Object Reference Diagram - 1 1

entity_1_1_objectref-reference.repoobject_referencedreferencing

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-reference.repoobject_referencedreferencing

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-reference.repoobject_referencedreferencing

Column Reference Diagram

entity_1_1_colref-reference.repoobject_referencedreferencing

Indexes

idx_RepoObject_ReferencedReferencing__1

Column Details

_

referenced_AntoraXref

referenced_AntoraXref

nvarchar(max)

NOT NULL

referenced_external_AntoraComponent

referenced_external_AntoraComponent

nvarchar(128)

NULL

referenced_external_AntoraModule

referenced_external_AntoraModule

nvarchar(128)

NULL

Referenced_fullname

Referenced_fullname

nvarchar(261)

NOT NULL

Description

(concat('[',[referenced_schema_name],'].[',[referenced_entity_name],']'))


Referenced_fullname2

Referenced_fullname2

nvarchar(257)

NOT NULL

Description

(concat([referenced_schema_name],'.',[referenced_entity_name]))


Referenced_guid

Referenced_guid

uniqueidentifier

NOT NULL

referenced_is_DocsOutput

referenced_is_DocsOutput

int

NULL

Referenced Columns

referenced_is_external

referenced_is_external

bit

NOT NULL

Referenced_type

Referenced_type

char(2)

NULL

referencing_AntoraXref

referencing_AntoraXref

nvarchar(max)

NOT NULL

referencing_external_AntoraComponent

referencing_external_AntoraComponent

nvarchar(128)

NULL

referencing_external_AntoraModule

referencing_external_AntoraModule

nvarchar(128)

NULL

Referencing_fullname

Referencing_fullname

nvarchar(261)

NOT NULL

Description

(concat('[',[referencing_schema_name],'].[',[referencing_entity_name],']'))


Referencing_fullname2

Referencing_fullname2

nvarchar(257)

NOT NULL

Description

(concat([referencing_schema_name],'.',[referencing_entity_name]))


Referencing_guid

Referencing_guid

uniqueidentifier

NOT NULL

referencing_is_DocsOutput

referencing_is_DocsOutput

int

NULL

Referenced Columns

referencing_is_external

referencing_is_external

bit

NOT NULL

Referencing_type

Referencing_type

varchar(2)

NULL

sql_modules_definition

reference.RepoObject_ReferencedReferencing - V script
/*
per referencing RepoObject all directly referenced RepoOobject are listed

can be used in both directions:

* get all referenced per referencing
* get all referencing per referenced

////
old logic:

uses graph tables

* [graph].[RepoObject]
* [graph].[ReferencedObject]

Select Object1.RepoObject_fullname As Referencing_fullname , Object1.RepoObject_fullname2 As Referencing_fullname2 , Object1.RepoObject_guid As Referencing_guid , Object1.RepoObject_type As Referencing_type , Object2.RepoObject_fullname As Referenced_fullname , Object2.RepoObject_fullname2 As Referenced_fullname2 , Object2.RepoObject_guid As Referenced_guid , Object2.RepoObject_type As Referenced_type From graph.RepoObject As Object1 , graph.ReferencedObject As referenced , graph.RepoObject As Object2 Where Match( Object1-(referenced)→Object2);

////

*/
CREATE View reference.RepoObject_ReferencedReferencing
As
Select
    T1.referenced_fullname
  , T1.referenced_fullname2
  , Referenced_guid           = T1.referenced_RepoObject_guid
  , referenced_is_DocsOutput  = typ1.is_DocsOutput
  , T1.referenced_type
  , T1.referenced_external_AntoraComponent
  , T1.referenced_external_AntoraModule
  , T1.referenced_is_external
  , referenced_AntoraXref     = Concat (
                                           --* xref:target-page-filename.adoc[link text]
                                           --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                                           Cast('* xref:' As NVarchar(Max))
                                         --, T1.referenced_external_AntoraComponent + ':'
                                         --, T1.referenced_external_AntoraModule + ':'
                                         , T1.referenced_AntoraComponent + ':'
                                         , T1.referenced_AntoraModule + ':'
                                         , docs.fs_cleanStringForFilename ( T1.referenced_fullname2 )
                                         , '.adoc[]'
                                         , ' in xref:' + T1.referenced_external_AntoraComponent + ':'
                                           + T1.referenced_external_AntoraModule + ':' + 'nav/objects-by-schema.adoc[]'
                                       )
  , T1.referencing_fullname
  , T1.referencing_fullname2
  , Referencing_guid          = T1.referencing_RepoObject_guid
  , T1.referencing_type
  , T1.referencing_external_AntoraComponent
  , T1.referencing_external_AntoraModule
  , T1.referencing_is_external
  , referencing_is_DocsOutput = typ2.is_DocsOutput
  , referencing_AntoraXref    = Concat (
                                           --* xref:target-page-filename.adoc[link text]
                                           --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                                           Cast('* xref:' As NVarchar(Max))
                                         --, T1.referencing_external_AntoraComponent + ':'
                                         --, T1.referencing_external_AntoraModule + ':'
                                         , T1.referencing_AntoraComponent + ':'
                                         , T1.referencing_AntoraModule + ':'
                                         , docs.fs_cleanStringForFilename ( T1.referencing_fullname2 )
                                         , '.adoc[]'
                                         , ' in xref:' + T1.referencing_external_AntoraComponent + ':'
                                           + T1.referencing_external_AntoraModule + ':' + 'nav/objects-by-schema.adoc[]'
                                       )
From
    reference.RepoObject_reference_T As T1
    Left Outer Join
        configT.type                 As typ1
            On
            typ1.type = T1.referenced_type

    Left Outer Join
        configT.type                 As typ2
            On
            typ2.type = T1.referencing_type