Discussion:
how to show what a stored procedure depends on
(too old to reply)
m***@gmail.com
2012-10-07 13:00:22 UTC
Permalink
I thought that sp_depends could be used to show which tables, views and stored procedures a stored procedure depends on. But apparantly the use of sp_depends is unreliable. I read that when sps/tables/views get deleted and recreated this can cause sp_depends to become out of date. Sadly, this deletion and recreation might be going on in the DB I am using at the moment. Hence I cannot rely on sp_depends. Does anyone know of any other tool that can be used to do this?

I can only think that such a tool must retrieve the text for the stored proc and parse it for table names (which might be views) and stored procedure invocations.

I heard there is a proprietary tool called CAST that might do the job but I would much prefer an open source tool since I am a shameless freeloader :-)

-Andrew Marlow
h***@gmail.com
2013-03-28 02:44:11 UTC
Permalink
Post by m***@gmail.com
I thought that sp_depends could be used to show which tables, views and stored procedures a stored procedure depends on. But apparantly the use of sp_depends is unreliable. I read that when sps/tables/views get deleted and recreated this can cause sp_depends to become out of date. Sadly, this deletion and recreation might be going on in the DB I am using at the moment. Hence I cannot rely on sp_depends. Does anyone know of any other tool that can be used to do this?
I can only think that such a tool must retrieve the text for the stored proc and parse it for table names (which might be views) and stored procedure invocations.
I heard there is a proprietary tool called CAST that might do the job but I would much prefer an open source tool since I am a shameless freeloader :-)
-Andrew Marlow
If you drop and recreate the stored procedure, the sp_depends will be accurate.

- Matthew Parslow

Loading...