Josje on Mon, 09 Sep 2013 07:55:51

Hi there,

I am getting to old for this,

If I open View Dependencies of say a Table Valued Function in SSMS 2008R2 I can get a grafic list of all object the depend on the TVF. How do I get this result in a table? Obviously some kind of recursive function of either sp_depend or sys.dm_sql_referenced_entities or sys.dm_sql_referencing_entities is involved. But I can find no example in the internet???

So if Porc/Function X depends on Proc/Function Y and Proc/Function Y depends on Proc/Function Z and Proc/Function A depends on Proc/Function Z and Proc/Function X depends on Proc/Function A I like a table like this:

Caller Called

  Z         Y
  Z         X
  Z         A

I Like a table of all proc/functions that depend on a particular proc/function where only distinct names are listed as directly dependend on the particular proc/function.

I'll be back