repo.RepoObjectColumn_MissingSource_TypeV - V

type: V ( view ), modify_date: 2022-01-05 18:06:34

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

Description

Examples

Entity Diagram

entity-repo.repoobjectcolumn_missingsource_typev

Columns

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

bit

NULL

bit

NULL

int

NOT NULL

bit

NULL

int

NOT NULL

uniqueidentifier

NULL

int

NULL

nvarchar(max)

NULL

bit

NULL

nvarchar(128)

NULL

nvarchar(max)

NULL

tinyint

NOT NULL

int

NULL

sql_variant

NULL

bit

NOT NULL

bit

NOT NULL

bit

NULL

bit

NULL

sql_variant

NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

bit

NULL

nvarchar(261)

NOT NULL

uniqueidentifier

NOT NULL

uniqueidentifier

NOT NULL

nvarchar(128)

NOT NULL

nvarchar(261)

NOT NULL

int

NULL

nvarchar(128)

NOT NULL

Foreign Key Diagram

entity_1_1_fk-repo.repoobjectcolumn_missingsource_typev

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo.repoobjectcolumn_missingsource_typev

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo.repoobjectcolumn_missingsource_typev

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo.repoobjectcolumn_missingsource_typev

Column Reference Diagram

entity_1_1_colref-repo.repoobjectcolumn_missingsource_typev

Indexes

idx_RepoObjectColumn_MissingSource_TypeV__1

idx_RepoObjectColumn_MissingSource_TypeV__2

idx_RepoObjectColumn_MissingSource_TypeV__3

idx_RepoObjectColumn_MissingSource_TypeV__4

Column Details

_

has_different_sys_names

has_different_sys_names

bit

NULL

Description

(CONVERT([bit],case when [RepoObjectColumn_name]<>[SysObjectColumn_name] then (1) else (0) end))


is_query_plan_expression

is_query_plan_expression

bit

NULL

is_RepoObjectColumn_name_uniqueidentifier

is_RepoObjectColumn_name_uniqueidentifier

int

NOT NULL

Description

(case when TRY_CAST([RepoObjectColumn_name] AS [uniqueidentifier]) IS NULL then (0) else (1) end)


is_SysObjectColumn_missing

is_SysObjectColumn_missing

bit

NULL

is_SysObjectColumn_name_uniqueidentifier

is_SysObjectColumn_name_uniqueidentifier

int

NOT NULL

Description

(case when TRY_CAST([SysObjectColumn_name] AS [uniqueidentifier]) IS NULL then (0) else (1) end)


persistence_source_RepoObjectColumn_guid

persistence_source_RepoObjectColumn_guid

uniqueidentifier

NULL

Referencing_Count

Referencing_Count

int

NULL

Repo_default_definition

Repo_default_definition

nvarchar(max)

NULL

Repo_default_is_system_named

Repo_default_is_system_named

bit

NULL

Repo_default_name

Repo_default_name

nvarchar(128)

NULL

Repo_definition

Repo_definition

nvarchar(max)

NULL

Repo_generated_always_type

Repo_generated_always_type

tinyint

NOT NULL

Repo_graph_type

Repo_graph_type

int

NULL

Repo_increment_value

Repo_increment_value

sql_variant

NULL

Repo_is_computed

Repo_is_computed

bit

NOT NULL

Repo_is_identity

Repo_is_identity

bit

NOT NULL

Repo_is_nullable

Repo_is_nullable

bit

NULL

Repo_is_persisted

Repo_is_persisted

bit

NULL

Repo_seed_value

Repo_seed_value

sql_variant

NULL

Repo_user_type_fullname

Repo_user_type_fullname

nvarchar(128)

NULL

Repo_user_type_name

Repo_user_type_name

nvarchar(128)

NULL

Repo_uses_database_collation

Repo_uses_database_collation

bit

NULL

RepoObject_fullname

RepoObject_fullname

nvarchar(261)

NOT NULL

Description

(concat('[',[RepoObject_schema_name],'].[',[RepoObject_name],']'))


RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

RepoObjectColumn_guid

RepoObjectColumn_guid

uniqueidentifier

NOT NULL

RepoObjectColumn_name

RepoObjectColumn_name

nvarchar(128)

NOT NULL

SysObject_fullname

SysObject_fullname

nvarchar(261)

NOT NULL

Description

(concat('[',[SysObject_schema_name],'].[',[SysObject_name],']'))


SysObjectColumn_column_id

SysObjectColumn_column_id

int

NULL

SysObjectColumn_name

SysObjectColumn_name

nvarchar(128)

NOT NULL

sql_modules_definition

repo.RepoObjectColumn_MissingSource_TypeV - V script
CREATE View [repo].[RepoObjectColumn_MissingSource_TypeV]
As
--
Select
    roc.RepoObjectColumn_guid
  , roc.RepoObject_guid
  , roc.RepoObjectColumn_name
  , roc.SysObjectColumn_name
  , roc.SysObjectColumn_column_id
  , roc.Repo_default_definition
  , roc.Repo_default_is_system_named
  , roc.Repo_default_name
  , roc.Repo_definition
  , roc.Repo_generated_always_type
  , roc.Repo_graph_type
  , roc.Repo_is_computed
  , roc.Repo_is_identity
  , roc.Repo_is_nullable
  , roc.Repo_is_persisted
  , roc.Repo_seed_value
  , roc.Repo_increment_value
  , roc.Repo_user_type_name
  , roc.Repo_user_type_fullname
  , roc.Repo_uses_database_collation
  , roc.is_SysObjectColumn_missing
  , roc.persistence_source_RepoObjectColumn_guid
  , roc.Referencing_Count
  , roc.is_query_plan_expression
  , roc.has_different_sys_names
  , roc.is_RepoObjectColumn_name_uniqueidentifier
  , roc.is_SysObjectColumn_name_uniqueidentifier
  , ro.RepoObject_fullname
  , ro.SysObject_fullname
From
    repo.RepoObjectColumn As roc
    Inner Join
        repo.RepoObject   As ro
            On
            ro.RepoObject_guid = roc.RepoObject_guid
Where
    --view
    ro.SysObject_type = 'V'
    And Not Exists
(
    Select
        1
    From
        [reference].RepoObjectColumn_reference_T As roc_r
    Where
        roc_r.referencing_RepoObject_guid                          = roc.RepoObject_guid
        And roc_r.referencing_RepoObjectColumn_guid                = roc.RepoObjectColumn_guid
        And
        (
            roc_r.is_referenced_object                             = 1
            Or roc_r.is_referencing_object_equal_referenced_object = 1
        )
);