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 A
.
How best to do this?
Can I write something like this pseudocode:
select name from AllStoredProcedures as Asp where Asp.TextualContent contains 'A'
Asp.TextualContent
means the actual SQL contained in the SP.
SELECT OBJECT_NAME(object_id),
definition
FROM sys.sql_modules
WHERE objectproperty(object_id,'IsProcedure') = 1
AND definition like '%Foo%'