property.RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition - V
type: V ( view ), modify_date: 2022-01-05 18:06:34
RepoObject_guid: 53B33A4A-426D-EB11-84E2-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Indexes
idx_RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition__1
-
IndexSemanticGroup: no_group
-
[column-RepoObjectColumn_guid]; uniqueidentifier
-
[column-property_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition__2
-
IndexSemanticGroup: no_group
-
[column-RepoObjectColumn_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition__3
-
IndexSemanticGroup: no_group
-
[column-RepoObjectColumn_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition__4
-
IndexSemanticGroup: no_group
-
[column-property_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
Column Details
_
sql_modules_definition
property.RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition - V script
/*
--The result must be grouped to determine all required calculation variants of an inheritance
SELECT is_StringAggAllSources
, resulting_InheritanceDefinition
FROM repo.RepoObjectColumn_InheritanceType_resulting_InheritanceDefinition
GROUP BY is_StringAggAllSources
, resulting_InheritanceDefinition
HAVING (NOT (resulting_InheritanceDefinition IS NULL))
*/
CREATE View property.RepoObjectColumnProperty_InheritanceType_resulting_InheritanceDefinition
As
Select
--
inh.RepoObjectColumn_guid
, inh.property_name
, inh.property_value
, inh.InheritanceType
, is_force_inherit_empty_source =
--
Case
When inh.InheritanceType = 14
Then
1
Else
0
End
, is_StringAggAllSources =
--
Case
When Not inh.Inheritance_StringAggSeparatorSql Is Null
Then
1
Else
0
End
, inh.Inheritance_StringAggSeparatorSql
, resulting_InheritanceDefinition =
--
Case
When (
inh.InheritanceType = 11
And inh.property_value Is Null
)
Or
(
inh.InheritanceType = 12
And NullIf(inh.property_value, '') Is Null
)
Or inh.InheritanceType = 13
Or inh.InheritanceType = 14
Then
IsNull (
inh.InheritanceDefinition
, '[property].[fs_get_RepoObjectColumnProperty_nvarchar]([referenced].[RepoObjectColumn_guid], [referencing].[property_name])'
)
End
--normally the result from [resulting_InheritanceDefinition] should not be empty to be inherited
--this will avoid existing property_value to be deleted
--but inheritance can be forced (dangerous!)
, inh.InheritanceDefinition
, inh.RepoObjectColumn_name
From
property.RepoObjectColumnProperty_InheritanceType_InheritanceDefinition As inh