sqlparse.RepoObject_SqlModules_24_IdentifierList_children - V
type: V ( view ), modify_date: 2021-08-17 20:07:39
RepoObject_guid: 3B90291C-9D61-EB11-84DC-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
1 |
|
|
||
2 |
|
|
||
3 |
|
|
||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
Indexes
PK_RepoObject_SqlModules_24_IdentifierList_children
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
[column-json_key]; nvarchar(4000)
-
[column-T2_json_key]; nvarchar(4000)
-
-
PK, Unique, Real: 1, 1, 0
idx_RepoObject_SqlModules_24_IdentifierList_children__2
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
[column-json_key]; nvarchar(4000)
-
-
PK, Unique, Real: 0, 0, 0
idx_RepoObject_SqlModules_24_IdentifierList_children__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_24_IdentifierList_children - V script
CREATE View sqlparse.RepoObject_SqlModules_24_IdentifierList_children
As
--
Select
T1.RepoObject_guid
, T1.json_key
, T2_json_key = T2.json_key
, T1.SysObject_fullname
, T1.RowNumber_per_Object
, T1.class
--, [T1].[is_group]
--, [T1].[is_keyword]
--, [T1].[is_whitespace]
, T1.normalized
--, [T1].[children]
, T2_class = T2.class
, Identifier_alias = Case T2.class
When 'Identifier'
Then
Case
When T2.child1_normalized Is Null
Then
T2.child0_normalized
When T2.child1_normalized = 'AS'
Then
T2.child2_normalized
When T2.child3_normalized = 'AS'
Then
T2.child4_normalized
When T2.child1_normalized = '.'
Then
T2.child2_normalized
End
When 'Comparison'
Then
Case
When T2.child1_normalized = '='
Then
T2.child0_normalized
End
End
, Identifier_source = Case T2.class
When 'Identifier'
Then
Case T2.child0_class
When 'Token'
Then
T2.normalized
When 'Function'
Then
T2.child0_normalized
End
When 'Comparison'
Then
Case
When T2.child1_normalized = '='
Then
T2.child2_normalized
End
End
, Identifier_source_class = Case T2.class
When 'Identifier'
Then
Case T2.child0_class
When 'Token'
Then
T2.class
When 'Function'
Then
T2.child0_class
End
When 'Comparison'
Then
Case
When T2.child1_normalized = '='
Then
T2.child2_class
End
End
, Identifier_source_children = Case T2.class
When 'Identifier'
Then
Case T2.child0_class
When 'Token'
Then
T2.children
When 'Function'
Then
T2.child0_children
End
When 'Comparison'
Then
Case
When T2.child1_normalized = '='
Then
T2.child2_children
End
End
, T2.is_group
, T2.is_keyword
, T2.is_whitespace
--, [T2].[normalized]
, T2.children
, T2.child0_class
, T2.child0_is_group
, T2.child0_is_keyword
, T2.child0_is_whitespace
, T2.child0_normalized
, T2.child0_children
, T2.child1_class
, T2.child1_is_group
, T2.child1_is_keyword
, T2.child1_is_whitespace
, T2.child1_normalized
, T2.child1_children
, T2.child2_class
, T2.child2_is_group
, T2.child2_is_keyword
, T2.child2_is_whitespace
, T2.child2_normalized
, T2.child2_children
, T2.child3_class
, T2.child3_is_group
, T2.child3_is_keyword
, T2.child3_is_whitespace
, T2.child3_normalized
, T2.child3_children
, T2.child4_class
, T2.child4_is_group
, T2.child4_is_keyword
, T2.child4_is_whitespace
, T2.child4_normalized
, T2.child4_children
From
sqlparse.RepoObject_SqlModules_20_statement_children As T1
Cross Apply sqlparse.ftv_sqlparse_with_some_children ( T1.children ) As T2
Where
T1.class = 'IdentifierList'
And T2.class In
( 'Identifier', 'Comparison' )
----there was any reason for this filter
----now we remove it, but we need to check the case of 'Identifier'
-- AND [T2].[class] = 'Comparison'