repo.RepoObjectColumn_external_src - V

type: V ( view ), modify_date: 2021-12-22 11:49:45

RepoObject_guid: C2D025E7-1A1B-EC11-8520-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo.repoobjectcolumn_external_src

Columns

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

1

uniqueidentifier

NOT NULL

int

NOT NULL

uniqueidentifier

NULL

nvarchar(128)

NOT NULL

nvarchar(128)

NOT NULL

Foreign Key Diagram

entity_1_1_fk-repo.repoobjectcolumn_external_src

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo.repoobjectcolumn_external_src

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo.repoobjectcolumn_external_src

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo.repoobjectcolumn_external_src

Column Reference Diagram

entity_1_1_colref-repo.repoobjectcolumn_external_src

Indexes

PK_RepoObjectColumn_external_src

idx_RepoObjectColumn_external_src__2

idx_RepoObjectColumn_external_src__3

idx_RepoObjectColumn_external_src__4

Column Details

_

RepoObjectColumn_guid

1

RepoObjectColumn_guid

uniqueidentifier

NOT NULL

is_SysObjectColumn_missing

is_SysObjectColumn_missing

int

NOT NULL

RepoObject_guid

RepoObject_guid

uniqueidentifier

NULL

RepoObjectColumn_name

RepoObjectColumn_name

nvarchar(128)

NOT NULL

SysObjectColumn_name

SysObjectColumn_name

nvarchar(128)

NOT NULL

sql_modules_definition

repo.RepoObjectColumn_external_src - V script
/*
<<property_start>>Description
* converts xref:sqldb:reference.additional_reference_objectcolumn_t.adoc[] into xref:sqldb:repo.repoobjectcolumn.adoc[]
* [ ] todo: solve issues with same external object names like internal names
<<property_end>>
*/
CREATE View repo.RepoObjectColumn_external_src
As
Select
    --PK: RepoObjectColumn_guid
    T2.RepoObjectColumn_guid
  , ro.RepoObject_guid
  , RepoObjectColumn_name      = T2.ColumnName
  , SysObjectColumn_name       = T2.ColumnName
  , is_SysObjectColumn_missing = 0
--, Repo_user_type_name        = T2.tables_columns_dataType
--, Repo_user_type_fullname    = T2.tables_columns_dataType
From
    reference.additional_Reference_ObjectColumn_T As T2
    Left Join
        reference.additional_Reference_Object_T   As ro
            On
            ro.AntoraComponent  = T2.AntoraComponent
            And ro.AntoraModule = T2.AntoraModule
            And ro.SchemaName   = T2.SchemaName
            And ro.ObjectName   = T2.ObjectName
--workaround to solve issues with not imported same named external objects
Where
    Exists
(
    Select
        1
    From
        repo.RepoObject As tgt
    Where
        tgt.RepoObject_guid = ro.RepoObject_guid
)