repo.RepoObject_persistence_target_Ignore - V

type: V ( view ), modify_date: 2022-01-05 19:34:19

RepoObject_guid: 3F2E3185-576E-EC11-8539-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo.repoobject_persistence_target_ignore

Columns

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

nvarchar(4000)

NULL

int

NOT NULL

nvarchar(4000)

NULL

uniqueidentifier

NULL

uniqueidentifier

NULL

uniqueidentifier

NULL

nvarchar(128)

NULL

uniqueidentifier

NOT NULL

Foreign Key Diagram

entity_1_1_fk-repo.repoobject_persistence_target_ignore

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo.repoobject_persistence_target_ignore

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo.repoobject_persistence_target_ignore

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo.repoobject_persistence_target_ignore

Column Reference Diagram

entity_1_1_colref-repo.repoobject_persistence_target_ignore

Indexes

idx_RepoObject_persistence_target_Ignore__1

idx_RepoObject_persistence_target_Ignore__2

idx_RepoObject_persistence_target_Ignore__3

Column Details

_

ColumnListIgnore

ColumnListIgnore

nvarchar(4000)

NULL

is_persistence_Ignore

is_persistence_Ignore

int

NOT NULL

NoCompareButUpdate_Column

NoCompareButUpdate_Column

nvarchar(4000)

NULL

RepoObject_guid

RepoObject_guid

uniqueidentifier

NULL

RepoObjectColumn_guid

RepoObjectColumn_guid

uniqueidentifier

NULL

source_RepoObject_guid

source_RepoObject_guid

uniqueidentifier

NULL

source_RepoObject_name

source_RepoObject_name

nvarchar(128)

NULL

target_RepoObject_guid

target_RepoObject_guid

uniqueidentifier

NOT NULL

sql_modules_definition

repo.RepoObject_persistence_target_Ignore - V script
/*
ColumnListIgnore is an attribute of the persistence. +
normally it can't be applied to the target, because it could not exist in the target, if it is ignored. +
But if it exists in the target object, it needs to be applied. +
That's why this information needs to be applied to the source and to the target:

* it needs to be applied to the source in any case, +
  but not as update of repo.RepoObjectColumn, but in the moment, when missing columns are detected in
  repo.usp_sync_guid_RepoObjectColumn
* it also needs to be applied to the target, if it exists in the target +
  in this case repo.RepoObjectColumn should be updated

This is a bit dirty. But how to do different?

*/
CREATE View repo.RepoObject_persistence_target_Ignore
As
Select
    T1.target_RepoObject_guid
  , T1.source_RepoObject_guid
  , T1.source_RepoObject_name
  , T1.ColumnListIgnore
  , NoCompareButUpdate_Column = Trim ( T2.value )
  , T3.RepoObject_guid
  , T3.RepoObjectColumn_guid
  , is_persistence_Ignore     = Iif(T3.RepoObjectColumn_guid Is Null, 0, 1)
From
    repo.RepoObject_persistence                        As T1
    Cross Apply String_Split(T1.ColumnListIgnore, ',') As T2
    Left Join
        --target RepoObject
        repo.RepoObjectColumn As T3
            On
            T3.RepoObject_guid = T1.target_RepoObject_guid
            And T3.Column_name = Trim ( T2.value )