docs.RepoObject_Plantuml_ColRefList_1_1 - V

type: V ( view ), modify_date: 2022-09-19 12:19:51

RepoObject_guid: 5AC03C7F-23F6-EB11-850C-A81E8446D5B0

Description

Examples

Entity Diagram

entity-docs.repoobject_plantuml_colreflist_1_1

Columns

Table 1. Columns of docs.RepoObject_Plantuml_ColRefList_1_1 - V
PK Column Name Data Type NULL? ID

nvarchar(max)

NULL

nvarchar(10)

NOT NULL

uniqueidentifier

NOT NULL

Foreign Key Diagram

entity_1_1_fk-docs.repoobject_plantuml_colreflist_1_1

References

Referencing Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-docs.repoobject_plantuml_colreflist_1_1

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-docs.repoobject_plantuml_colreflist_1_1

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-docs.repoobject_plantuml_colreflist_1_1

Column Reference Diagram

entity_1_1_colref-docs.repoobject_plantuml_colreflist_1_1

Indexes

idx_RepoObject_Plantuml_ColRefList_1_1__1

idx_RepoObject_Plantuml_ColRefList_1_1__2

Column Details

_

ColRefList

ColRefList

nvarchar(max)

NULL

cultures_name

cultures_name

nvarchar(10)

NOT NULL

RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

sql_modules_definition

docs.RepoObject_Plantuml_ColRefList_1_1 - V script
CREATE View docs.RepoObject_Plantuml_ColRefList_1_1
As
Select
    ro.RepoObject_guid
  , ro.cultures_name
  --, ro.RepoObject_fullname2
  , ColRefList =
  --
  String_Agg (
                 Concat (
                            Cast(N'' As NVarchar(Max))
                          , '"'
                          , Iif(colref.referenced_is_external = 1
                              , colref.referenced_external_AntoraComponent + '.'
                                + colref.referenced_external_AntoraModule + '.'
                              , Null)
                          , docs.fs_cleanStringForPuml ( colref.Referenced_ro_fullname2 )
                          , '::'
                          , docs.fs_cleanStringForPuml ( colref.Referenced_ro_ColumnName )
                          , '"'
                          , ' <-- '
                          , '"'
                          , Iif(colref.referencing_is_external = 1
                              , colref.referencing_external_AntoraComponent + '.'
                                + colref.referencing_external_AntoraModule + '.'
                              , Null)
                          , docs.fs_cleanStringForPuml ( colref.Referencing_ro_fullname2 )
                          , '::'
                          , docs.fs_cleanStringForPuml ( referencing_trans.RepoObjectColumn_DisplayName )
                          , '"'
                        )
               , Char ( 13 ) + Char ( 10 )
             ) Within Group(Order By
                                colref.Referenced_ro_fullname2
                              , colref.Referenced_ro_ColumnName
                              , colref.Referencing_ro_fullname2
                              , referencing_trans.RepoObjectColumn_DisplayName)
From
    docs.RepoObject_OutputFilter_T          As ro
    Inner Join
    (
        --Select
        --    Object1.RepoObject_fullname2  As Referencing_ro_fullname2
        --  , Object1.RepoObject_guid       As Referencing_ro_guid
        --  , Object1.RepoObjectColumn_name As Referencing_ro_ColumnName
        --  , Object2.RepoObject_fullname2  As Referenced_ro_fullname2
        --  , Object2.RepoObject_guid       As Referenced_ro_guid
        --  , Object2.RepoObjectColumn_name As Referenced_ro_ColumnName
        --From
        --    graph.RepoObjectColumn As Object1
        --  , graph.ReferencedObjectColumn As referenced
        --  , graph.RepoObjectColumn As Object2
        --Where Match(
        --    Object1-(referenced)->Object2)
        Select
            Referenced_ro_guid                  = referenced_RepoObject_guid
          , Referenced_ro_fullname2             = referenced_ro_fullname2
          , Referenced_ro_ColumnName            = referenced_column_name
          , referenced_external_AntoraComponent
          , referenced_external_AntoraModule
          , referenced_is_external
          , referenced_RepoObjectColumn_guid
          , Referencing_ro_guid                 = referencing_RepoObject_guid
          , Referencing_ro_fullname2            = referencing_ro_fullname2
          , Referencing_ro_ColumnName           = referencing_column_name
          , referencing_external_AntoraComponent
          , referencing_external_AntoraModule
          , referencing_is_external
          , referencing_RepoObjectColumn_guid
        From
            reference.RepoObjectColumn_reference_T
    )                                       As colref
        On
        colref.Referencing_ro_guid                  = ro.RepoObject_guid
        Or colref.Referenced_ro_guid                = ro.RepoObject_guid
           --exclude column references inside object (calculated columns):
           And colref.Referencing_ro_guid           <> colref.Referenced_ro_guid

    --currently we need only translation for referencing columns
    --because translations ar implemented only in ssas
    --and references are implemented only between referenced external data source (no culture) and referencing ssas table columns

    Left Join
        ssas.RepoObjectColumn_translation_T As referencing_trans
            On
            referencing_trans.RepoObjectColumn_guid = colref.referencing_RepoObjectColumn_guid
            And referencing_trans.cultures_name     = ro.cultures_name
Group By
    ro.RepoObject_guid
  , ro.cultures_name