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_nameabcde
-
use one line to mark the end point:
<<property_end>>
-
-
The correct sequence must be followed. Nested parsing is not supported.
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
1 |
|
|
||
2 |
|
|
||
|
|
Indexes
PK_RepoObjectProperty_Collect_source_sql_modules_definition
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
[column-property_name]; nvarchar(128)
-
-
PK, Unique, Real: 1, 1, 0
idx_RepoObjectProperty_Collect_source_sql_modules_definition__2
-
IndexSemanticGroup: no_group
-
[column-RepoObject_guid]; uniqueidentifier
-
-
PK, Unique, Real: 0, 0, 0
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