Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- o1.type AS object1_type,
- OBJECT_SCHEMA_NAME(d.referencing_id) AS [object1_scheme_name],
- OBJECT_NAME(d.referencing_id) AS [object1_name],
- o2.type AS object2_type,
- OBJECT_SCHEMA_NAME(d.referenced_id) AS [object2_scheme_name],
- OBJECT_NAME(d.referenced_id) AS [object2_name]
- FROM sys.sql_expression_dependencies d
- INNER JOIN sys.objects o1 ON o1.[object_id] = d.referencing_id
- INNER JOIN sys.objects o2 ON o2.[object_id] = d.referenced_id
- WHERE d.referencing_id <> d.referenced_id and
- o1.type NOT IN ('C') AND
- o2.type NOT IN ('C') AND
- OBJECT_SCHEMA_NAME(d.referencing_id) NOT IN ('sys', 'pm', 'alog', 'mnt') and
- OBJECT_SCHEMA_NAME(d.referenced_id) NOT IN ('sys', 'pm', 'alog', 'mnt') AND
- OBJECT_NAME(d.referencing_id) NOT LIKE '%cube%' and
- OBJECT_NAME(d.referenced_id) NOT LIKE '%cube%'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement