repo_sys.RepoObjectReferenced - V

type: V ( view ), modify_date: 2021-08-17 20:02:13

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

Description

Examples

Entity Diagram

entity-repo_sys.repoobjectreferenced

Columns

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

bit

NULL

bit

NOT NULL

bit

NOT NULL

bit

NOT NULL

bit

NOT NULL

bit

NOT NULL

bit

NULL

bit

NOT NULL

bit

NOT NULL

bit

NOT NULL

tinyint

NULL

nvarchar(60)

NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

int

NULL

int

NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

nvarchar(128)

NULL

int

NULL

nvarchar(261)

NOT NULL

uniqueidentifier

NOT NULL

nvarchar(261)

NOT NULL

int

NULL

datetime

NULL

char(2)

NULL

Foreign Key Diagram

entity_1_1_fk-repo_sys.repoobjectreferenced

References

Object Reference Diagram - 1 1

entity_1_1_objectref-repo_sys.repoobjectreferenced

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo_sys.repoobjectreferenced

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo_sys.repoobjectreferenced

Column Reference Diagram

entity_1_1_colref-repo_sys.repoobjectreferenced

Indexes

idx_RepoObjectReferenced__1

Column Details

_

has_different_sys_names

has_different_sys_names

bit

NULL

Description

(CONVERT([bit],case when [RepoObject_schema_name]<>[SysObject_schema_name] OR [RepoObject_name]<>[SysObject_name] OR [RepoObject_type]<>[SysObject_type] then (1) else (0) end))


is_all_columns_found

is_all_columns_found

bit

NOT NULL

is_ambiguous

is_ambiguous

bit

NOT NULL

is_caller_dependent

is_caller_dependent

bit

NOT NULL

is_incomplete

is_incomplete

bit

NOT NULL

is_insert_all

is_insert_all

bit

NOT NULL

is_repo_managed

is_repo_managed

bit

NULL

Referenced Columns

is_select_all

is_select_all

bit

NOT NULL

is_selected

is_selected

bit

NOT NULL

is_updated

is_updated

bit

NOT NULL

referenced_class

referenced_class

tinyint

NULL

referenced_class_desc

referenced_class_desc

nvarchar(60)

NULL

referenced_database_name

referenced_database_name

nvarchar(128)

NULL

referenced_entity_name

referenced_entity_name

nvarchar(128)

NULL

referenced_id

referenced_id

int

NULL

referenced_minor_id

referenced_minor_id

int

NULL

referenced_minor_name

referenced_minor_name

nvarchar(128)

NULL

referenced_schema_name

referenced_schema_name

nvarchar(128)

NULL

referenced_server_name

referenced_server_name

nvarchar(128)

NULL

referencing_minor_id

referencing_minor_id

int

NULL

RepoObject_fullname

RepoObject_fullname

nvarchar(261)

NOT NULL

Description

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


RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

Referenced Columns

SysObject_fullname

SysObject_fullname

nvarchar(261)

NOT NULL

Description

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


SysObject_id

SysObject_id

int

NULL

Referenced Columns

SysObject_modify_date

SysObject_modify_date

datetime

NULL

SysObject_type

SysObject_type

char(2)

NULL

Referenced Columns

sql_modules_definition

repo_sys.RepoObjectReferenced - V script
/*
this view can be used to check if SysObject renaming is safe or if exists referenced objects and refactoring is required
*/
CREATE View repo_sys.RepoObjectReferenced
As
--
Select
    ro.RepoObject_guid
  --, [ro].[RepoObject_schema_name]
  --, [ro].[RepoObject_name]
  --, [ro].[RepoObject_type]
  , ro.SysObject_id
  --, [ro].[SysObject_schema_name]
  --, [ro].[SysObject_name]
  , ro.SysObject_type
  , ro.SysObject_modify_date
  --, [ro].[has_execution_plan_issue]
  , ro.is_repo_managed
  --, [ro].[modify_dt]
  , ro.has_different_sys_names
  , ro.RepoObject_fullname
  , ro.SysObject_fullname
  , referencing_minor_id     = referenced.referencing_minor_id
  , referenced_server_name   = referenced.referenced_server_name Collate Database_Default
  , referenced_database_name = referenced.referenced_database_name Collate Database_Default
  , referenced_schema_name   = referenced.referenced_schema_name Collate Database_Default
  , referenced_entity_name   = referenced.referenced_entity_name Collate Database_Default
  , referenced_minor_name    = referenced.referenced_minor_name Collate Database_Default
  , referenced_id            = referenced.referenced_id
  , referenced_minor_id      = referenced.referenced_minor_id
  , referenced_class         = referenced.referenced_class
  , referenced_class_desc    = referenced.referenced_class_desc Collate Database_Default
  , is_caller_dependent      = referenced.is_caller_dependent
  , is_ambiguous             = referenced.is_ambiguous
  , is_selected              = referenced.is_selected
  , is_updated               = referenced.is_updated
  , is_select_all            = referenced.is_select_all
  , is_all_columns_found     = referenced.is_all_columns_found
  , is_insert_all            = referenced.is_insert_all
  , is_incomplete            = referenced.is_incomplete
From
    repo.RepoObject                                                                    As ro
    Cross Apply sys_dwh.dm_sql_referenced_entities ( ro.SysObject_fullname, 'OBJECT' ) As referenced
Where
    IsNull ( ro.has_get_referenced_issue, 0 ) = 0