repo.Index_ColumList - V

type: V ( view ), modify_date: 2021-09-10 11:15:39

RepoObject_guid: 6890291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo.index_columlist

Columns

Table 1. Columns of repo.Index_ColumList - V
PK Column Name Data Type NULL? ID

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

uniqueidentifier

NOT NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-repo.index_columlist

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-repo.index_columlist

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo.index_columlist

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo.index_columlist

Column Reference Diagram

entity_1_1_colref-repo.index_columlist

Indexes

idx_Index_ColumList__1

Column Details

_

AntoraIndexColumnList

AntoraIndexColumnList

nvarchar(max)

NULL

ColumnList

ColumnList

nvarchar(max)

NULL

Referencing Columns

ConstraintColumnList

ConstraintColumnList

nvarchar(max)

NULL

DbmlIndexColumnList

DbmlIndexColumnList

nvarchar(max)

NULL

index_guid

index_guid

uniqueidentifier

NOT NULL

Referencing Columns

PersistenceWhereColumnList

PersistenceWhereColumnList

nvarchar(max)

NULL

PumlIndexColumnList

PumlIndexColumnList

nvarchar(max)

NULL

sql_modules_definition

repo.Index_ColumList - V script
CREATE View [repo].[Index_ColumList]
As
Select
    col.index_guid
  , AntoraIndexColumnList      =
  --
  String_Agg (
                 Concat (
                            Cast(N'' As NVarchar(Max))
                          , '* <<column-' + col.SysObject_column_name + '>>; '
                          , col.SysObject_column_user_type_fullname
                        )
               , Char ( 13 ) + Char ( 10 )
             ) Within Group(Order By
                                col.index_column_id)
  --ColumnList doesn't contain Asc and Desc
  , ColumnList                 =
  --
  String_Agg ( Concat (
                          --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                          Cast(' ' As NVarchar(Max)), QuoteName ( col.SysObject_column_name )
                      )
             , ','
             ) Within Group(Order By
                                col.index_column_id)
  --ConstraintColumnList contains Asc and Desc
  , ConstraintColumnList       =
  --
  String_Agg (
                 Concat (
                            --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                            Cast(' ' As NVarchar(Max))
                          , QuoteName ( col.SysObject_column_name )
                          , Case col.is_descending_key
                                When 1
                                    Then
                                    ' DESC'
                                Else
                                    ' ASC'
                            End
                        )
               , ','
             ) Within Group(Order By
                                col.index_column_id)
  , DbmlIndexColumnList        =
  --
  String_Agg ( Concat (
                          --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                          Cast(' ' As NVarchar(Max)), QuoteName ( col.SysObject_column_name, '"' )
                      )
             , ','
             ) Within Group(Order By
                                col.index_column_id)
  , PersistenceWhereColumnList =
  --
  Stuff (
            String_Agg (
                           Concat (
                                      --we need to convert to first argument nvarchar(max) to avoid the limit of 8000 byte
                                      Cast('AND T.' As NVarchar(Max))
                                    , QuoteName ( col.SysObject_column_name )
                                    , ' = S.'
                                    , QuoteName ( col.SysObject_column_name )
                                    , Char ( 13 )
                                    , Char ( 10 )
                                  )
                         , ''
                       ) Within Group(Order By
                                          col.index_column_id)
          , 1
          , 4
          , Null
        )
  , PumlIndexColumnList        =
  --
  String_Agg (
                 Concat (
                            Cast(N'' As NVarchar(Max))
                          , col.SysObject_column_name + '; '
                          , col.SysObject_column_user_type_fullname
                        )
               , Char ( 13 ) + Char ( 10 )
             ) Within Group(Order By
                                col.index_column_id)
From
    repo.IndexColumn_union_T As col
Group By
    col.index_guid