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

Description

Examples

Entity Diagram

entity-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

Columns

Table 1. Columns of sqlparse.RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit - V
PK Column Name Data Type NULL? ID

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(500)

NULL

nvarchar(4000)

NULL

nvarchar(4000)

NULL

nvarchar(4000)

NOT NULL

nvarchar(max)

NULL

uniqueidentifier

NOT NULL

bigint

NULL

nvarchar(261)

NULL

nvarchar(500)

NULL

nvarchar(4000)

NOT NULL

Foreign Key Diagram

entity_1_1_fk-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

References

Object Reference Diagram - 1 1

entity_1_1_objectref-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

Column Reference Diagram

entity_1_1_colref-sqlparse.repoobject_sqlmodules_25_identifierlist_children_identifiersplit

Indexes

idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__1

idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__2

idx_RepoObject_SqlModules_25_IdentifierList_children_IdentifierSplit__3

Column Details

_

class

class

nvarchar(500)

NULL

Identifier_source_column

Identifier_source_column

nvarchar(4000)

NULL

Identifier_source_table

Identifier_source_table

nvarchar(4000)

NULL

SysObject_fullname

SysObject_fullname

nvarchar(261)

NULL

Description

(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