configT.type_level1type_level2type - V

type: V ( view ), modify_date: 2021-10-02 13:23:34

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

Description

Mappping from configT.type - V (used in [type] in system catalog views) to level1type (used in sp_addextendedproperty, sp_updateextendedproperty)

Examples

Entity Diagram

entity-configt.type_level1type_level2type

Columns

Table 1. Columns of configT.type_level1type_level2type - V
PK Column Name Data Type NULL? ID

1

nvarchar(128)

NULL

varchar(9)

NULL

varchar(10)

NULL

nvarchar(128)

NULL

Foreign Key Diagram

entity_1_1_fk-configt.type_level1type_level2type

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-configt.type_level1type_level2type

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-configt.type_level1type_level2type

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-configt.type_level1type_level2type

Column Reference Diagram

entity_1_1_colref-configt.type_level1type_level2type

Indexes

PK_type_level1type_level2type

  • IndexSemanticGroup: no_group

    • type; nvarchar(128)

  • PK, Unique, Real: 1, 1, 0

sql_modules_definition

configT.type_level1type_level2type - V script
/*
<<property_start>>Description
Mappping from xref:configt.type.adoc[] (used in [type] in system catalog views)
to `level1type` (used in sp_addextendedproperty, sp_updateextendedproperty)
<<property_end>>
*/
CREATE View [configT].[type_level1type_level2type]
--WITH SCHEMABINDING
As
--
Select
    type
  , type_desc
  , level1type = Case
                     When type = 'AF'
                         Then
                         'AGGREGATE'
                     --When [type] = 'D '
                     --Then 'DEFAULT'
                     When type In
                     ( 'FN', 'FS', 'FT', 'IF', 'IS', 'TF' )
                         Then
                         'FUNCTION'
                     --WHEN [type] = 'V ' THEN 'LOGICAL FILE NAME'
                     When type In
                     ( 'P ', 'PC', 'RF', 'X ' )
                         Then
                         'PROCEDURE'
                     When type = 'SQ'
                         Then
                         'QUEUE'
                     When type = 'R '
                         Then
                         'RULE'
                     When type = 'SN'
                         Then
                         'SYNONYM'
                     When type = 'U '
                         Then
                         'TABLE'
                     --WHEN [type] = 'V ' THEN 'TABLE_TYPE'
                     --WHEN [type] = 'V ' THEN 'TYPE'
                     When type = 'V '
                         Then
                         'VIEW'
                     --WHEN [type] = 'V ' THEN 'XML SCHEMA COLLECTION'
                 End
  , level2type = Case type
                     When 'C'
                         Then
                         'CONSTRAINT' --CHECK_CONSTRAINT
                     When 'D'
                         Then
                         'CONSTRAINT' --DEFAULT_CONSTRAINT
                     When 'EC'
                         Then
                         'CONSTRAINT' --EDGE_CONSTRAINT
                     When 'F'
                         Then
                         'CONSTRAINT' --FOREIGN_KEY_CONSTRAINT
                     When 'PK'
                         Then
                         'CONSTRAINT' --PRIMARY_KEY_CONSTRAINT
                     When 'UQ'
                         Then
                         'CONSTRAINT' --UNIQUE_CONSTRAINT
                 End
From
    configT.type