Technical Article

Nested Stored Procedure

,

Hi,

Query to get all the stored procedure name and nested procedure or sub procedure which are call by another procedure.

Note : Uncomment where clause from the query if you dont want the procedure which are not calling any procedure to ommit the null values.

 

SELECT objectname [Proc name], d.name [Nested Proc] FROM
(
SELECT o.object_id, o.name objectname, d.depid FROM sysdepends d
join sys.objects o on d.id = o.object_id and Type = 'p'
where readobj = 0
) o LEFT JOIN sys.objects d on d.object_id = o.depid and type = 'p'
--WHERE d.name is not null
ORDER BY objectname

Rate

4.5 (4)

You rated this post out of 5. Change rating

Share

Share

Rate

4.5 (4)

You rated this post out of 5. Change rating