docs.Measure_MeasurePropertyList - V

type: V ( view ), modify_date: 2021-11-28 10:57:14

RepoObject_guid: 308D889D-3250-EC11-8532-A81E8446D5B0

Description

Examples

Entity Diagram

entity-docs.measure_measurepropertylist

Columns

Table 1. Columns of docs.Measure_MeasurePropertyList - V
PK Column Name Data Type NULL? ID

uniqueidentifier

NOT NULL

nvarchar(max)

NULL

nvarchar(max)

NOT NULL

Foreign Key Diagram

entity_1_1_fk-docs.measure_measurepropertylist

References

Referencing Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-docs.measure_measurepropertylist

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-docs.measure_measurepropertylist

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-docs.measure_measurepropertylist

Column Reference Diagram

entity_1_1_colref-docs.measure_measurepropertylist

Indexes

idx_Measure_MeasurePropertyList__1

Column Details

_

Measure_guid

Measure_guid

uniqueidentifier

NOT NULL

Referenced Columns

MeasurePropertyList

MeasurePropertyList

nvarchar(max)

NULL

MeasurePropertyTable

MeasurePropertyTable

nvarchar(max)

NOT NULL

sql_modules_definition

docs.Measure_MeasurePropertyList - V script
/*
we could create different content for different cultures.
But currently the content for all cultures is the same
*/
CREATE View docs.Measure_MeasurePropertyList
As
Select
    rom.Measure_guid
  , MeasurePropertyList  =
  --
  String_Agg (
                 Concat (
                            --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                            Cast(N'' As NVarchar(Max))

                          --add additional line to get more space
                          , '{empty} +'
                          , Char ( 13 ) + Char ( 10 ) + Char ( 13 ) + Char ( 10 )
                          , '.' + mp.property_name
                          , Char ( 13 ) + Char ( 10 )
                          , Iif(pn.NoOfCollapsibleChars > 1
                              , '[%collapsible]' + Char ( 13 ) + Char ( 10 )
                                + Replicate ( '=', pn.NoOfCollapsibleChars ) + Char ( 13 ) + Char ( 10 )
                              , '')
                          , Iif(pn.NoOfExampleChars > 1
                                , Replicate ( '=', pn.NoOfExampleChars ) + Char ( 13 ) + Char ( 10 )
                                , '')
                          , Iif(pn.NoOfListingChars > 1
                                , Replicate ( '-', pn.NoOfListingChars ) + Char ( 13 ) + Char ( 10 )
                                , '')
                          , Char ( 13 ) + Char ( 10 )
                          --escape some special characters
                          , Replace ( mp.property_value, '|', '\|' )
                          , Char ( 13 ) + Char ( 10 )
                          , Iif(pn.NoOfListingChars > 1
                                , Replicate ( '-', pn.NoOfListingChars ) + Char ( 13 ) + Char ( 10 )
                                , '')
                          , Iif(pn.NoOfExampleChars > 1
                                , Replicate ( '=', pn.NoOfExampleChars ) + Char ( 13 ) + Char ( 10 )
                                , '')
                          , Iif(pn.NoOfCollapsibleChars > 1
                                , Replicate ( '=', pn.NoOfCollapsibleChars ) + Char ( 13 ) + Char ( 10 )
                                , '')
                          , Char ( 13 ) + Char ( 10 ) + Char ( 13 ) + Char ( 10 )
                        )
               , Char ( 13 ) + Char ( 10 )
             ) Within Group(Order By
                                pn.OrderInAntoraMeasureDetails)
  , MeasurePropertyTable =
  --
  Concat (
             Cast(N'' As NVarchar(Max))
           --, '[#measureproperties-'
           --, docs.fs_cleanStringForAnchorId ( ParameterName )
           --, ']'
           --, Char ( 13 ) + Char ( 10 )
           --, '=== '
           --, docs.fs_cleanStringForHeader ( ParameterName )
           --, Char ( 13 ) + Char ( 10 ) + Char ( 13 ) + Char ( 10 )

           --table start
           , '[cols="1,5a"]' + Char ( 13 ) + Char ( 10 )
           , '|===' + Char ( 13 ) + Char ( 10 )
           , Char ( 13 ) + Char ( 10 )

           --table content
           , String_Agg (
                            Concat (
                                       --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                                       Cast(N'' As NVarchar(Max))
                                     , '|' + mp.property_name + Char ( 13 ) + Char ( 10 )
                                     , '|' + Char ( 13 ) + Char ( 10 )
                                     , Iif(pn.NoOfCollapsibleChars > 1
                                         , '[%collapsible]' + Char ( 13 ) + Char ( 10 )
                                           + Replicate ( '=', pn.NoOfCollapsibleChars ) + Char ( 13 ) + Char ( 10 )
                                         , '')
                                     , Iif(pn.NoOfExampleChars > 1
                                           , Replicate ( '=', pn.NoOfExampleChars ) + Char ( 13 ) + Char ( 10 )
                                           , '')
                                     , Iif(pn.NoOfListingChars > 1
                                           , Replicate ( '-', pn.NoOfListingChars ) + Char ( 13 ) + Char ( 10 )
                                           , '')
                                     --escape some special characters
                                     , Replace ( mp.property_value, '|', '\|' )
                                     , Char ( 13 ) + Char ( 10 )
                                     , Iif(pn.NoOfListingChars > 1
                                           , Replicate ( '-', pn.NoOfListingChars ) + Char ( 13 ) + Char ( 10 )
                                           , '')
                                     , Iif(pn.NoOfExampleChars > 1
                                           , Replicate ( '=', pn.NoOfExampleChars ) + Char ( 13 ) + Char ( 10 )
                                           , '')
                                     , Iif(pn.NoOfCollapsibleChars > 1
                                           , Replicate ( '=', pn.NoOfCollapsibleChars ) + Char ( 13 ) + Char ( 10 )
                                           , '')
                                   )
                          , Char ( 13 ) + Char ( 10 )
                        ) Within Group(Order By
                                           pn.OrderInAntoraMeasureDetails)

           --table end
           , '|===' + Char ( 13 ) + Char ( 10 )
         )
From
    repo.Measure                       As rom
    Inner Join
        property.MeasureProperty        As mp
            On
            mp.Measure_guid                    = rom.Measure_guid

    Inner Join
        property.PropertyName_Measure_T As pn
            On
            pn.property_name                   = mp.property_name
            And pn.OrderInAntoraMeasureDetails > 0
Group By
    rom.Measure_guid