text: ﻿
  CREATE View reference.RepoObjectColumn_reference_additional_internal
  As
  --
  Select
      T1.referencing_id
    --, referencing_minor_id                          = roc.SysObjectColumn_column_id
    --, referencing_node_id                           = roc.node_id
    , T1.referenced_id
    --, referenced_minor_id                           = roc2.SysObjectColumn_column_id
    --, referenced_node_id                            = roc2.node_id
    , T1.referencing_RepoObject_guid
    , T1.referencing_RepoObjectColumn_guid
    , T1.referenced_RepoObject_guid
    , T1.referenced_RepoObjectColumn_guid
    , T1.referencing_type
    , referencing_schema_name                       = T1.referencing_Schema
    , referencing_entity_name                       = T1.referencing_Object
    , referencing_column_name                       = T1.referencing_Column
    , referenced_schema_name                        = T1.referenced_Schema
    , referenced_entity_name                        = T1.referenced_Object
    , referenced_column_name                        = T1.referenced_Column
    , T1.referenced_type
    , InformationSource                             = 'reference.additional_Reference'
    , is_referencing_object_equal_referenced_object = Cast(Case
                                                               When T1.referenced_RepoObject_guid = T1.referencing_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    = ro_r.referencing_RepoObject_guid
              And ro_r.referenced_RepoObject_guid = ro_r.referenced_RepoObject_guid
      )
    --, ros.is_hidden
    , is_computed                                   = Cast(Null As Bit)
    , definition                                    = Cast(Null As NVarchar(Max))
  From
      reference.additional_Reference_guid As T1
  Where
      T1.referenced_is_external      = 0
      And T1.referencing_is_external = 0
      And Not T1.referenced_RepoObjectColumn_guid Is Null
      And Not T1.referencing_RepoObjectColumn_guid Is Null
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7508fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'definition';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7408fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'is_computed';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7308fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'is_referenced_object';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7208fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'is_referencing_object_equal_referenced_object';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7108fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'InformationSource';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7008fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_type';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6f08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_column_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6e08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_entity_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6d08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_schema_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6c08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_column_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6b08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_entity_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6a08fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_schema_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6908fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_type';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6808fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_RepoObjectColumn_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6708fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_RepoObject_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6608fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_RepoObjectColumn_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6508fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_RepoObject_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6408fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_id';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '6308fcfd-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_id';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObject_guid', @value = '9fb0b5f7-b004-ec11-8514-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectList', @value = N'* [reference].[additional_Reference_guid]
  * [reference].[RepoObject_reference_T]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'is_ssas', @value = N'0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'is_repo_managed', @value = N'0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal';
  
  
  GO
  
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'AntoraReferencedList', @value = N'* xref:reference.additional_Reference_guid.adoc[]
  * xref:reference.RepoObject_reference_T.adoc[]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_type]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_type';
  
  
  GO
  
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_Schema]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_schema_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_RepoObjectColumn_guid]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_RepoObjectColumn_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_RepoObject_guid]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_RepoObject_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_id]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_id';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_Object]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_entity_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referencing_Column]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referencing_column_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_type]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_type';
  
  
  GO
  
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_Schema]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_schema_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_RepoObjectColumn_guid]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_RepoObjectColumn_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_RepoObject_guid]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_RepoObject_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_id]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_id';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_Object]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_entity_name';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectColumnList', @value = N'* [reference].[additional_Reference_guid].[referenced_Column]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObjectColumn_reference_additional_internal', @level2type = N'COLUMN', @level2name = N'referenced_column_name';
  
  