property.RepoObjectProperty_Collect_source_sql_modules_definition - V

type: V ( view ), modify_date: 2022-09-08 16:34:59

RepoObject_guid: BC24DF58-0B9A-EB11-84F5-A81E8446D5B0

Description

  • extracts properties from sql_modules_definition

  • properties can be added (normally in comments) following this syntax

    • use one line to mark the starting point for parsing: <<property_start>>abcde markes the property_name abcde

    • use one line to mark the end point: <<property_end>>

  • The correct sequence must be followed. Nested parsing is not supported.

Examples

Entity Diagram

entity-property.repoobjectproperty_collect_source_sql_modules_definition

Columns

Table 1. Columns of property.RepoObjectProperty_Collect_source_sql_modules_definition - V
PK Column Name Data Type NULL? ID

1

uniqueidentifier

NOT NULL

2

nvarchar(128)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-property.repoobjectproperty_collect_source_sql_modules_definition

References

Object Reference Diagram - 1 1

entity_1_1_objectref-property.repoobjectproperty_collect_source_sql_modules_definition

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-property.repoobjectproperty_collect_source_sql_modules_definition

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-property.repoobjectproperty_collect_source_sql_modules_definition

Column Reference Diagram

entity_1_1_colref-property.repoobjectproperty_collect_source_sql_modules_definition

Indexes

PK_RepoObjectProperty_Collect_source_sql_modules_definition

idx_RepoObjectProperty_Collect_source_sql_modules_definition__2

Column Details

_

RepoObject_guid

1

RepoObject_guid

uniqueidentifier

NOT NULL

property_name

2

property_name

nvarchar(128)

NULL

property_value

property_value

nvarchar(max)

NULL

sql_modules_definition

property.RepoObjectProperty_Collect_source_sql_modules_definition - V script
/*
<<property_start>>Description
* extracts properties from sql_modules_definition
* properties can be added (normally in comments) following this syntax
** use one line to mark the starting point for parsing: `\<<property_start>>abcde` markes the property_name `abcde`
** use one line to mark the end point: `\<<property_end>>`
* The correct sequence must be followed. Nested parsing is not supported.
<<property_end>>
*/
CREATE View property.RepoObjectProperty_Collect_source_sql_modules_definition
As
Select
    --
    RepoObject_guid
  , property_name  = Trim ( Cast(es.substring_netPreEol As NVarchar(128)))
  , property_value = Cast(String_Agg ( Cast(es.substring_netPostEol As NVarchar(Max)), Char ( 13 ) + Char ( 10 )) Within Group(Order By
                                                                                                                                   es.pos1) As NVarchar(Max))
From
    sqlparse.RepoObject_SqlModules_Repo_Sys
    Cross Apply tool.ftv_extract_substrings (
                                                sql_modules_definition
                                              , Char ( 13 ) + Char ( 10 ) + '<<property_start>>'
                                              , Char ( 13 ) + Char ( 10 ) + '<<property_end>>'
                                            ) As es
Where
    es.substring_netPreEol <> ''
Group By
    RepoObject_guid
  , es.substring_netPreEol