Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

T-SQL - Where Used List (Table/View)

select schema_name(o.schema_id) + '.' + o.name as [table],
       'is used by' as ref,
       schema_name(ref_o.schema_id) + '.' + ref_o.name as [object],
       ref_o.type_desc as object_type
from sys.objects o
join sys.sql_expression_dependencies dep
     on o.object_id = dep.referenced_id
join sys.objects ref_o
     on dep.referencing_id = ref_o.object_id
where o.type in ('V', 'U')
      and schema_name(o.schema_id) = 'Person'  -- put schema name here
      and o.name = 'Person'   -- put table/view name here
order by [object]
Source by dataedo.com #
 
PREVIOUS NEXT
Tagged: #Where #Used #List
ADD COMMENT
Topic
Name
1+5 =