Is there an easy way to chase down table/stored procedure/function dependencies in SQL Server 2005+? I've inherited a giant application with lots of tables and even more stored procedures and functions that are long and interlinked.
At the end of the day is there a way to build a dependency tree? Ideally what I'm looking for goes in both directions:
For a table/procedure - what depends ON it?: Show me all the stored procedures that eventually reference it (ideally in a tree view such that sub procedures nest out to the bigger procedures that call them)
For a procedure - what does IT depend on?: Show me all the procedures and tables that a given procedure will (or could) touch when running.
It seems this tool shouldn't be that hard to make and would be incredibly useful for DB maintenance generally. Is anyone aware of such a thing? If this doesn't exist, why the heck not?
The built-in functionality in Management Studio is nice but the information does not appear to be complete at all.
See Question&Answers more detail:os