repo_sys.RepoObjectReferencing - V

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

RepoObject_guid: 0A90291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Entity Diagram

entity-repo_sys.repoobjectreferencing

Columns

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

bit

NULL

bit

NOT NULL

bit

NULL

tinyint

NULL

nvarchar(60)

NULL

sysname

NULL

int

NOT NULL

sysname

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.repoobjectreferencing

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-repo_sys.repoobjectreferencing

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-repo_sys.repoobjectreferencing

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-repo_sys.repoobjectreferencing

Column Reference Diagram

entity_1_1_colref-repo_sys.repoobjectreferencing

Indexes

idx_RepoObjectReferencing__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_caller_dependent

is_caller_dependent

bit

NOT NULL

is_repo_managed

is_repo_managed

bit

NULL

Referenced Columns

referencing_class

referencing_class

tinyint

NULL

referencing_class_desc

referencing_class_desc

nvarchar(60)

NULL

referencing_entity_name

referencing_entity_name

sysname

NULL

referencing_id

referencing_id

int

NOT NULL

referencing_schema_name

referencing_schema_name

sysname

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.RepoObjectReferencing - V script
/*
this view can be used to check if SysObject renaming is safe or if exists referencing objects and refactoring is required
*/
CREATE View repo_sys.RepoObjectReferencing
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.referencing_schema_name
  , referencing.referencing_entity_name
  , referencing.referencing_id
  , referencing.referencing_class
  , referencing.referencing_class_desc
  , referencing.is_caller_dependent
From
    repo.RepoObject                                                                 As ro
    Cross Apply sys.dm_sql_referencing_entities ( ro.SysObject_fullname, 'OBJECT' ) As referencing