I am looking for a functionality in reverse to sp_depends
. sp_depends
gives names of objects that the current object is using.
I want to get info in a reverse manner i.e. what all objects(procs in my case) calls the given proc ?
I am using Sybase 12.5
I hope it will help you:
declare @Proc varchar(30)
select @Proc='ProcName'
select sod.name
from sysobjects so
join sysdepends sd on sd.id = so.id
join sysobjects sod on sod.id = sd.depid
where so.name = @Proc
and sod.type = 'P'