repo_sys.SysSchema - V

type: V ( view ), modify_date: 2021-08-17 20:04:28

RepoObject_guid: AF0747EC-8CA3-EB11-84FA-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo_sys.sysschema

Columns

Table 1. Columns of repo_sys.SysSchema - V
PK Column Name Data Type NULL? ID

int

NOT NULL

sysname

NOT NULL

int

NULL

uniqueidentifier

NULL

Foreign Key Diagram

entity_1_1_fk-repo_sys.sysschema

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo_sys.sysschema

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo_sys.sysschema

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo_sys.sysschema

Column Reference Diagram

entity_1_1_colref-repo_sys.sysschema

Column Details

_

SysSchema_name

SysSchema_name

sysname

NOT NULL

SysSchema_principal_id

SysSchema_principal_id

int

NULL

SysSchema_RepoSchema_guid

SysSchema_RepoSchema_guid

uniqueidentifier

NULL

sql_modules_definition

repo_sys.SysSchema - V script
CREATE View repo_sys.SysSchema
As
--
Select
    SysSchema_id              = sch.schema_id
  , SysSchema_name            = sch.name Collate Database_Default
  , SysSchema_principal_id    = sch.principal_id
  , SysSchema_RepoSchema_guid = Try_Cast(ep.property_value As UniqueIdentifier)
From
    sys_dwh.schemas                 As sch
    Left Outer Join
        repo_sys.ExtendedProperties As ep
            On
            ep.major_id          = sch.schema_id
            And ep.minor_id      = 0
            And ep.class         = 3 /*class 3 - Schema*/
            And ep.property_name = N'RepoSchema_guid';

-- Where [sch].[name] <> 'sys'