repo.RepoObject_persistence_source_Ignore - V
type: V ( view ), modify_date: 2022-01-05 19:34:05
RepoObject_guid: 402E3185-576E-EC11-8539-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Indexes
idx_RepoObject_persistence_source_Ignore__1
-
IndexSemanticGroup: no_group
-
[column-RepoObjectColumn_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObject_persistence_source_Ignore__2
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObject_persistence_source_Ignore__3
-
IndexSemanticGroup: no_group
-
[column-target_RepoObject_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
Column Details
_
sql_modules_definition
repo.RepoObject_persistence_source_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_source_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
--source RepoObject
repo.RepoObjectColumn As T3
On
T3.RepoObject_guid = T1.source_RepoObject_guid
And T3.Column_name = Trim ( T2.value )