The chain of nested stored procedures

I have this SQL Server with many stored procedures distributed across all databases and I am looking for a way to find a way to bind these nested stored procedures to each other, so basically to see which stored procedure works.

Interestingly, someone who had the same problem found a way to get this information in some painless way, rather than opening each stored procedure and checking which other stored procedure works.

thank

+5
source share
2 answers

Approach No. 1

Right-click the table name and select "View Dependencies", as shown below, we look at the dependencies for the Employee table.

enter image description here


Approach No. 2

SELECT 
        routine_name, 
        routine_type 

FROM    INFORMATION_SCHEMA.ROUTINES

WHERE   ROUTINE_DEFINITION LIKE '%Your Object Name%'

№ 3

EXEC sp_depends 'Your Object Name'

№ 4

SELECT referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('Your Object Name', 'OBJECT');
+2

, , sys.sql_expression_dependencies sys.dm_sql_referenced_entities sys.dm_sql_referencing_entities.

, SQL- ( ), : SQL-.

0

All Articles