Hi
i have a stored proc that searches through stored proc etc text and returns the name if some text is found in it.
I would like to extend this so whne the stored procedure name is retrieved it checks to see if that stored proc is used in another stored proc. Thus building up a tree of dependencies (i dont want to use the sysdepend function). im sure there must be TSQL around that does this or could someone show me how to do this. My stored porc sample is below
TIA
Stu
DECLARE
@cSearch varchar(100)SET
@cSearch='%'+LTRIM(RTRIM(@p_cCallName))+'%'-- sql Server 2005
IF
CHARINDEX('9.00',@@VERSION)<>0 SELECT DISTINCT so.name FROM sys.objects so INNER JOIN sys.Sql_modules sc ON sc.object_id=so.object_id WHERE so.type IN('P','TR','FN') AND sc.definition LIKE @cSearch AND so.name<>@p_cCallName ORDER BY name