reference.ReferenceTree_cyclic_ref_PersistenceUsp - V

type: V ( view ), modify_date: 2021-11-18 09:19:42

RepoObject_guid: 82E72F09-C5FD-EB11-850F-A81E8446D5B0

Description

Examples

Entity Diagram

entity-reference.referencetree_cyclic_ref_persistenceusp

Columns

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

nvarchar(261)

NOT NULL

nvarchar(257)

NOT NULL

uniqueidentifier

NOT NULL

char(2)

NULL

nvarchar(261)

NOT NULL

nvarchar(257)

NOT NULL

uniqueidentifier

NOT NULL

varchar(2)

NULL

Foreign Key Diagram

entity_1_1_fk-reference.referencetree_cyclic_ref_persistenceusp

References

Object Reference Diagram - 1 1

entity_1_1_objectref-reference.referencetree_cyclic_ref_persistenceusp

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-reference.referencetree_cyclic_ref_persistenceusp

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-reference.referencetree_cyclic_ref_persistenceusp

Column Reference Diagram

entity_1_1_colref-reference.referencetree_cyclic_ref_persistenceusp

Indexes

idx_ReferenceTree_cyclic_ref_PersistenceUsp__1

Column Details

_

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_type

referenced_type

char(2)

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_type

referencing_type

varchar(2)

NULL

sql_modules_definition

reference.ReferenceTree_cyclic_ref_PersistenceUsp - V script
/*
cyclic references are detected between persistence source and persistence target

we want to include related persistence usp into the diagram

*/
CREATE View reference.ReferenceTree_cyclic_ref_PersistenceUsp
As
Select
    Distinct
    Referenced_guid  = T1.referenced_RepoObject_guid
  , Referencing_guid = T1.referencing_RepoObject_guid
  , T1.referencing_fullname
  , T1.referencing_fullname2
  , T1.referencing_type
  , T1.referenced_fullname
  , T1.referenced_fullname2
  , T1.referenced_type
From
    --get persistence usp
    reference.RepoObject_reference_T               As T1
    Inner Join
        reference.ReferenceTree_cyclic_ref_primary As T2
            On
            T1.referenced_RepoObject_guid = T2.Referencing_guid
Where
    --referencing object is a persistence usp
    ( T1.referencing_is_PersistenceUspTargetRef = 1 )
    --referenced object is the persistence target object
    And ( T1.referenced_is_PersistenceTarget    = 1 )