sqlparse.RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit - V
type: V ( view ), modify_date: 2021-08-17 20:09:24
RepoObject_guid: 3D90291C-9D61-EB11-84DC-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Indexes
idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__1
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
[column-json_key]; nvarchar(4000)
-
[column-T2_json_key]; nvarchar(4000)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__2
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
[column-json_key]; nvarchar(4000)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__3
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
Column Details
_
SysObject_fullname
SysObject_fullname |
|
|
(concat('[',[SysObject_schema_name],'].[',[SysObject_name],']'))
sql_modules_definition
sqlparse.RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit - V script
--in case of an simple identifier like [T1].[aaa]
--get the table part [Identifier_source_table] (before dot) and the column part [Identifier_source_column] (after dot)
CREATE View sqlparse.RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit
As
--
Select
T1.RepoObject_guid
, T1.json_key
, T1.T2_json_key
, T1.SysObject_fullname
, T1.RowNumber_per_Object
, T1.class
, T1.normalized
, T1.T2_class
, T1.Identifier_alias
, T1.Identifier_source
, T1.Identifier_source_class
, T1.Identifier_source_children
--in case of an simple identifier like [T1].[aaa] get the table part (before dot) and the column part (after dot)
, Identifier_source_table = Case T1.Identifier_source_class
When 'Identifier'
Then
Case
When T3.child1_normalized = '.'
And Not T3.child2_normalized Is Null
Then
T3.child0_normalized
When T3.child1_normalized Is Null
Then
Null
End
End
, Identifier_source_column = Case T1.Identifier_source_class
When 'Identifier'
Then
Case
When T3.child1_normalized = '.'
And Not T3.child2_normalized Is Null
Then
T3.child2_normalized
When T3.child1_normalized Is Null
Then
T3.child0_normalized
End
End
--, [T3].[child0_class]
--, [T3].[child0_is_group]
--, [T3].[child0_is_keyword]
--, [T3].[child0_normalized]
--, [T3].[child0_children]
--, [T3].[child1_class]
--, [T3].[child1_is_group]
--, [T3].[child1_is_keyword]
--, [T3].[child1_normalized]
--, [T3].[child1_children]
--, [T3].[child2_class]
--, [T3].[child2_is_group]
--, [T3].[child2_is_keyword]
--, [T3].[child2_normalized]
--, [T3].[child2_children]
--, [T3].[child3_class]
--, [T3].[child3_is_group]
--, [T3].[child3_is_keyword]
--, [T3].[child3_normalized]
--, [T3].[child3_children]
--, [T3].[child4_class]
--, [T3].[child4_is_group]
--, [T3].[child4_is_keyword]
--, [T3].[child4_normalized]
--, [T3].[child4_children]
From
sqlparse.RepoObject_SqlModules_24_IdentifierList_children As T1
Cross Apply sqlparse.ftv_sqlparse_children_pivot ( T1.Identifier_source_children ) As T3