sqlparse.RepoObject_SqlModules_21_statement_children_helper - V

type: V ( view ), modify_date: 2021-08-17 20:06:00

RepoObject_guid: F98F291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Entity Diagram

entity-sqlparse.repoobject_sqlmodules_21_statement_children_helper

Columns

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

nvarchar(max)

NULL

nvarchar(500)

NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

int

NOT NULL

bit

NULL

bit

NULL

bit

NULL

nvarchar(4000)

NOT NULL

nvarchar(max)

NULL

uniqueidentifier

NOT NULL

bigint

NULL

nvarchar(261)

NULL

Foreign Key Diagram

entity_1_1_fk-sqlparse.repoobject_sqlmodules_21_statement_children_helper

References

Object Reference Diagram - 1 1

entity_1_1_objectref-sqlparse.repoobject_sqlmodules_21_statement_children_helper

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-sqlparse.repoobject_sqlmodules_21_statement_children_helper

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-sqlparse.repoobject_sqlmodules_21_statement_children_helper

Column Reference Diagram

entity_1_1_colref-sqlparse.repoobject_sqlmodules_21_statement_children_helper

Indexes

idx_RepoObject_SqlModules_21_statement_children_helper__1

idx_RepoObject_SqlModules_21_statement_children_helper__2

Column Details

_

children

children

nvarchar(max)

NULL

class

class

nvarchar(500)

NULL

is_1_create

is_1_create

int

NOT NULL

is_2_view

is_2_view

int

NOT NULL

is_3_Identifier

is_3_Identifier

int

NOT NULL

is_4_as

is_4_as

int

NOT NULL

is_5_select

is_5_select

int

NOT NULL

is_6_Identifier

is_6_Identifier

int

NOT NULL

is_6_IdentifierList

is_6_IdentifierList

int

NOT NULL

is_7_from

is_7_from

int

NOT NULL

is_7_IdentifierList

is_7_IdentifierList

int

NOT NULL

is_8_IdentifierList

is_8_IdentifierList

int

NOT NULL

is_group

is_group

bit

NULL

is_keyword

is_keyword

bit

NULL

is_whitespace

is_whitespace

bit

NULL

json_key

json_key

nvarchar(4000)

NOT NULL

normalized

normalized

nvarchar(max)

NULL

RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

RowNumber_per_Object

RowNumber_per_Object

bigint

NULL

SysObject_fullname

SysObject_fullname

nvarchar(261)

NULL

Description

(concat('[',[SysObject_schema_name],'].[',[SysObject_name],']'))


sql_modules_definition

sqlparse.RepoObject_SqlModules_21_statement_children_helper - V script
/*helpers are required in next steps to check several conditions
here we prepare the check if the parsed statement will follow some required logic, for example
CREATE;VIEW;Identifier;AS;SELECT;IdentifierList;FROM
*/
CREATE View sqlparse.RepoObject_SqlModules_21_statement_children_helper
As
--
Select
    T1.RepoObject_guid
  , T1.json_key
  , T1.SysObject_fullname
  , T1.RowNumber_per_Object
  , T1.class
  , T1.is_group
  , T1.is_keyword
  , T1.is_whitespace
  , T1.normalized
  , T1.children
  --the entry 1 in the parsed sql is 'CREATE'
  , is_1_create         = Iif(T1.RowNumber_per_Object = 1 And T1.normalized = 'CREATE', 1, 0)
  --the entry 2 in the parsed sql is 'VIEW'
  , is_2_view           = Iif(T1.RowNumber_per_Object = 2 And T1.normalized = 'VIEW', 1, 0)
  , is_3_Identifier     = Iif(T1.RowNumber_per_Object = 3 And T1.class = 'Identifier', 1, 0)
  , is_4_as             = Iif(T1.RowNumber_per_Object = 4 And T1.normalized = 'AS', 1, 0)
  , is_5_select         = Iif(T1.RowNumber_per_Object = 5 And T1.normalized = 'SELECT', 1, 0)
  , is_6_Identifier     = Iif(T1.RowNumber_per_Object = 6 And T1.class = 'Identifier', 1, 0)
  , is_6_IdentifierList = Iif(T1.RowNumber_per_Object = 6 And T1.class = 'IdentifierList', 1, 0)
  , is_7_from           = Iif(T1.RowNumber_per_Object = 7 And T1.normalized = 'FROM', 1, 0)
  , is_7_IdentifierList = Iif(T1.RowNumber_per_Object = 7 And T1.class = 'IdentifierList', 1, 0)
  , is_8_IdentifierList = Iif(T1.RowNumber_per_Object = 8 And T1.class = 'IdentifierList', 1, 0)
From
    sqlparse.RepoObject_SqlModules_20_statement_children As T1