I am exploring a legacy database system and have very little knowledge of its internals. I would like to find all the stored procedures that invoke another stored procedure
For SQL Server 2005/2008:
SELECT s.name SchemaName
,o.name RoutineName
,o.[type] RoutineType
,procs.*
FROM sys.sql_modules procs
INNER JOIN sys.objects o ON procs.object_id = o.object_id
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
WHERE procs.[definition] LIKE '%A%'
--AND o.[type] = 'P' --'P' for stored procedures