In SQL Server, you can use the sys.sql_expression_dependencies
system catalog view to return all dependencies on a user-defined entity in the current database. This includes dependences between natively compiled, scalar user-defined functions and other SQL Server modules.
You can use this view to:
- Return entities that depend on a given entity
- Return entities on which a given entity depends
So for example, you could use it to return all objects that reference a specific table. You could also use it to return all objects that a specific stored procedure references within its code.
Continue reading