reference.Persistence - V

type: V ( view ), modify_date: 2021-12-16 11:41:19

RepoObject_guid: FEA5BB9C-A0F6-EB11-850C-A81E8446D5B0

Description

  • references between persistence tables and therefore between persistence procedures to call them in the right order

  • to get only relations between persistence tables (or views) the result set is limited:

    Where
        ro1.[is_persistence]     = 1
        And ro2.[is_persistence] = 1;

Examples

Entity Diagram

entity-reference.persistence

Columns

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

nvarchar(261)

NULL

uniqueidentifier

NULL

nvarchar(128)

NULL

nvarchar(140)

NULL

uniqueidentifier

NULL

nvarchar(261)

NULL

uniqueidentifier

NULL

nvarchar(128)

NULL

nvarchar(140)

NULL

uniqueidentifier

NULL

Foreign Key Diagram

entity_1_1_fk-reference.persistence

References

Object Reference Diagram - 1 1

entity_1_1_objectref-reference.persistence

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-reference.persistence

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-reference.persistence

Column Reference Diagram

entity_1_1_colref-reference.persistence

Indexes

idx_Persistence__1

idx_Persistence__2

idx_Persistence__3

idx_Persistence__4

idx_Persistence__5

idx_Persistence__6

Column Details

_

referenced_fullname

referenced_fullname

nvarchar(261)

NULL

Description

(concat('[',[RepoObject_schema_name],'].[',[RepoObject_name],']'))


referenced_RepoObject_guid

referenced_RepoObject_guid

uniqueidentifier

NULL

referenced_schema_name

referenced_schema_name

nvarchar(128)

NULL

referenced_usp_persistence_name

referenced_usp_persistence_name

nvarchar(140)

NULL

Description

('usp_PERSIST_'+[RepoObject_name])


referencing_fullname

referencing_fullname

nvarchar(261)

NULL

Description

(concat('[',[RepoObject_schema_name],'].[',[RepoObject_name],']'))


referencing_RepoObject_guid

referencing_RepoObject_guid

uniqueidentifier

NULL

referencing_schema_name

referencing_schema_name

nvarchar(128)

NULL

referencing_usp_persistence_name

referencing_usp_persistence_name

nvarchar(140)

NULL

Description

('usp_PERSIST_'+[RepoObject_name])


sql_modules_definition

reference.Persistence - V script
/*
<<property_start>>Description
* references between persistence tables and therefore between persistence procedures to call them in the right order
* to get only relations between persistence tables (or views) the result set is limited:
+
[source,sql]
------
Where
    ro1.[is_persistence]     = 1
    And ro2.[is_persistence] = 1;
------
<<property_end>>

*/
CREATE View reference.Persistence
As
Select
    Distinct
    referenced_RepoObject_guid                  = ro1.RepoObject_guid
  , referenced_fullname                         = ro1.RepoObject_fullname
  , referenced_schema_name                      = ro1.RepoObject_schema_name
  , referenced_usp_persistence_name             = ro1.usp_persistence_name
  , referenced_usp_persistence_RepoObject_guid  = ro1.usp_persistence_RepoObject_guid
  , referencing_RepoObject_guid                 = ro2.RepoObject_guid
  , referencing_fullname                        = ro2.RepoObject_fullname
  , referencing_schema_name                     = ro2.RepoObject_schema_name
  , referencing_usp_persistence_name            = ro2.usp_persistence_name
  , referencing_usp_persistence_RepoObject_guid = ro2.usp_persistence_RepoObject_guid
From
    reference.RepoObject_ReferenceTree As Q
    Left Join
        repo.RepoObject_gross          As ro1
            On
            ro1.RepoObject_guid = Q.Referenced_guid

    Left Join
        repo.RepoObject_gross          As ro2
            On
            ro2.RepoObject_guid = Q.RepoObject_guid
Where
    --Q.[Referenced_type] = 'U'
    --and
    Q.Referencing_Depth    = 0
    And ro1.is_persistence = 1
    And ro2.is_persistence = 1