Dependency graph
get_dependency_graphRetrieve foreign keys and module references as data to analyze database dependencies programmatically. Fails if login lacks permissions to read dependency views.
Instructions
Returns the dependency edges between database objects as data: foreign keys between tables, and references among views, procedures and functions. Use it to analyze dependencies programmatically; for a diagram use generate_dependency_dot, and for what references one table use get_table_usage. Fails, saying so, when the login cannot read sys.sql_expression_dependencies; without VIEW DEFINITION the module edges cover only modules the login can read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Filter by schema name. Empty means every schema. Example: 'Feeder' | |
| database | Yes | Name of the database as registered in the configuration. |