text: ﻿
  
  
  CREATE View reference.RepoObject_ReferenceTree_30_0
  As
  Select
      tree.RepoObject_guid
    , tree.Referencing_guid
    , tree.Referenced_guid
    , Referencing_Depth     = Min ( tree.Referencing_Depth )
    , Referencing_fullname  = Max ( tree.Referencing_fullname )
    , Referencing_fullname2 = Max ( tree.Referencing_fullname2 )
    , Referencing_type      = Max ( tree.Referencing_type )
    , Referenced_Depth      = Min ( tree.Referenced_Depth )
    , Referenced_fullname   = Max ( tree.Referenced_fullname )
    , Referenced_fullname2  = Max ( tree.Referenced_fullname2 )
    , Referenced_type       = Max ( tree.Referenced_type )
  From
      repo.RepoObject_gross                                                            As ro
      Cross Apply reference.ftv_RepoObject_ReferenceTree ( ro.RepoObject_guid, 30, 0 ) As tree
  Where
      ro.is_in_reference = 1
  Group By
      tree.RepoObject_guid
    , tree.Referencing_guid
    , tree.Referenced_guid
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7e244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referenced_type';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7d244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referenced_fullname2';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7c244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referenced_fullname';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7b244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referenced_Depth';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '7a244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referencing_type';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '79244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referencing_fullname2';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '78244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referencing_fullname';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '77244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referencing_Depth';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '76244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referenced_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '75244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'Referencing_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObjectColumn_guid', @value = '74244e70-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0', @level2type = N'COLUMN', @level2name = N'RepoObject_guid';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'RepoObject_guid', @value = 'd5e2805c-fdf5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'pk_IndexPatternColumnName', @value = N'RepoObject_guid,Referencing_guid,Referenced_guid', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'pk_IndexPatternColumnDatatype', @value = N'uniqueidentifier,uniqueidentifier,uniqueidentifier', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'pk_index_guid', @value = 'c411eece-fef5-eb11-850c-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'AntoraReferencingList', @value = N'* xref:reference.RepoObject_ReferenceTree_30_0_T.adoc[]
  * xref:reference.usp_PERSIST_RepoObject_ReferenceTree_30_0_T.adoc[]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'AntoraReferencedList', @value = N'* xref:reference.ftv_RepoObject_ReferenceTree.adoc[]
  * xref:repo.RepoObject_gross.adoc[]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'ReferencedObjectList', @value = N'* [reference].[ftv_RepoObject_ReferenceTree]
  * [repo].[RepoObject_gross]', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'is_ssas', @value = N'0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  
  GO
  EXECUTE sp_addextendedproperty @name = N'is_repo_managed', @value = N'0', @level0type = N'SCHEMA', @level0name = N'reference', @level1type = N'VIEW', @level1name = N'RepoObject_ReferenceTree_30_0';
  
  