Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. SELECT DISTINCT
  2. o1.type AS object1_type,
  3. OBJECT_SCHEMA_NAME(d.referencing_id) AS [object1_scheme_name],
  4. OBJECT_NAME(d.referencing_id) AS [object1_name],
  5. o2.type AS object2_type,
  6. OBJECT_SCHEMA_NAME(d.referenced_id) AS [object2_scheme_name],
  7. OBJECT_NAME(d.referenced_id) AS [object2_name]
  8. FROM sys.sql_expression_dependencies d
  9. INNER JOIN sys.objects o1 ON o1.[object_id] = d.referencing_id
  10. INNER JOIN sys.objects o2 ON o2.[object_id] = d.referenced_id
  11. WHERE d.referencing_id <> d.referenced_id and
  12. o1.type NOT IN ('C') AND
  13. o2.type NOT IN ('C') AND
  14. OBJECT_SCHEMA_NAME(d.referencing_id) NOT IN ('sys', 'pm', 'alog', 'mnt') and
  15. OBJECT_SCHEMA_NAME(d.referenced_id) NOT IN ('sys', 'pm', 'alog', 'mnt') AND
  16. OBJECT_NAME(d.referencing_id) NOT LIKE '%cube%' and
  17. OBJECT_NAME(d.referenced_id) NOT LIKE '%cube%'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement