Sysdepends is not automatically kept up to date by the server. It is only updated with you compile a stored procedure and any referenced object already exists. As an example, say that you had two stored procedures spA and spB and spB is dependent on spA. If you create spA and then create spB, sysdepends will be correct. OTOH, if you create spB before creating spA, sysdepends will not be correct. SQL Server will raise a warning message describing the situation.
-Mike
>Hi,
>
> I've been playing with the SP Sp_depends and table system table SysDepends. I've notice that some time I'm missing some dependencies. I'm trying building a script that will give me all dependencies for one specific object (table, udf, sp...)
>
>Here the SQL :
>
>Select C.Name as ParentName, B.Name as ChildName, A.Id, A.DepId
> From sysdepends A
> Inner join sysobjects B
> On A.Id = B.Id
> Inner join sysobjects C
> On A.DepId = C.Id
> Where C.Name = 'Customer' and b.xType = 'IF' -- all UDF for Customer
> Group by C.Name, B.Name, A.Id, A.DepId
>
>Now I've dropped the missing UDF and recreated it and when I rerun the same sql it shows up. is there's a way to "refresh" all dependencies so that this selection will see all?
>
>Alain
>Analystik Inc.