reference.RepoObjectColumn_reference_SqlModules - V
type: V ( view ), modify_date: 2022-01-05 18:06:35
RepoObject_guid: D28F8F21-4265-EB11-84DD-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
1 |
|
|
||
2 |
|
|
||
3 |
|
|
||
4 |
|
|
||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Indexes
PK_RepoObjectColumn_reference_SqlModules
-
IndexSemanticGroup: no_group
-
PK, Unique, Real: 1, 1, 0
idx_RepoObjectColumn_reference_SqlModules__2
-
IndexSemanticGroup: no_group
-
[column-referencing_schema_name]; nvarchar(128)
-
[column-referencing_entity_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumn_reference_SqlModules__3
-
IndexSemanticGroup: no_group
-
[column-referenced_schema_name]; nvarchar(128)
-
[column-referenced_entity_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumn_reference_SqlModules__4
-
IndexSemanticGroup: no_group
-
[column-referenced_column_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObjectColumn_reference_SqlModules__5
-
IndexSemanticGroup: no_group
-
[column-referencing_column_name]; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
Column Details
_
is_referencing_object_equal_referenced_object
is_referencing_object_equal_referenced_object |
|
|
referenced_node_id
referenced_node_id |
|
|
(CONVERT([bigint],[SysObject_id])*(10000))
referencing_node_id
referencing_node_id |
|
|
(CONVERT([bigint],[SysObject_id])*(10000))
referencing_RepoObject_guid
referencing_RepoObject_guid |
|
|
referencing_RepoObjectColumn_guid
referencing_RepoObjectColumn_guid |
|
|
sql_modules_definition
reference.RepoObjectColumn_reference_SqlModules - V script
CREATE View reference.RepoObjectColumn_reference_SqlModules
As
--
Select
referencing_id = ro_t.SysObject_id
, referencing_minor_id = roc_t.SysObjectColumn_column_id
, referencing_node_id = ro_t.node_id
, referenced_id = ro_s.SysObject_id
, referenced_minor_id = roc_s.SysObjectColumn_column_id
, referenced_node_id = ro_s.node_id
, referencing_RepoObject_guid = T1.RepoObject_guid
, referencing_RepoObjectColumn_guid = T1.RepoObjectColumn_guid
, referenced_RepoObject_guid = T1.source_RepoObject_guid
, referenced_RepoObjectColumn_guid = T1.source_RepoObjectColumn_guid
--Target = referencing: Repo Names or Sys Names?
--it is possible, that only Repo Objects exists, but they are not yet in the database
--or they could have other names in the database
--if they doesn't exist in the database guid are used as names
-- => Sys Names are fine
, referencing_type = ro_t.SysObject_type
, referencing_schema_name = ro_t.SysObject_schema_name
, referencing_entity_name = ro_t.SysObject_name
, referencing_column_name = roc_t.SysObjectColumn_name
--Source = referenced: Source should exists and we should use Sys Names
, referenced_schema_name = ro_s.SysObject_schema_name
, referenced_entity_name = ro_s.SysObject_name
, referenced_column_name = roc_s.SysObjectColumn_name
, referenced_type = ro_s.SysObject_type
, InformationSource = 'repo.RepoObject_persistence'
--persisted basic columns which are inherited are not computed
, is_computed = Cast(0 As Bit)
, definition = T1.normalized
, is_referencing_object_equal_referenced_object = Cast(Case
When T1.RepoObject_guid = T1.source_RepoObject_guid
Then
1
Else
0
End As Bit)
, is_referenced_object = Cast(1 As Bit)
--for easy error check
, T1.SysObject_fullname
From
sqlparse.RepoObject_SqlModules_79_reference_union As T1
Inner Join
repo.RepoObject As ro_s
On
ro_s.RepoObject_guid = T1.source_RepoObject_guid
Inner Join
repo.RepoObject As ro_t
On
ro_t.RepoObject_guid = T1.RepoObject_guid
Inner Join
repo.RepoObjectColumn As roc_s
On
roc_s.RepoObjectColumn_guid = T1.source_RepoObjectColumn_guid
Inner Join
repo.RepoObjectColumn As roc_t
On
roc_t.RepoObjectColumn_guid = T1.RepoObjectColumn_guid