Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_depends not showing dependencies

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
SQL Server 8

Hello,

I'm trying to run sp_depends on a view. Yesterday, it gave me both sides of dependencies (what it depends on, and what processes depends on it).

This morning, however, I'm just getting what the view references and/or depends on. Not good because I want to change a couple of JOINs in the view, but before I do I want to get record counts from whatever sp's/views/funcs depend on it. But now it won't tell me what's referencing my view.

Could there be some setting that's causing this malfunction?

Any ideas would be greatly appreciated.

Thanks,
Jason
 
AFAIK it is known that sp_depends is not the most reliable thing in the universe but... is any object up/down dependency chain modified in the meantime?

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
No, nothing at this point. Had to get 3rd party software to search through our databases to find out where it's referenced.

I figured it wouldn't be able to see dependencies that were dynamic (ie: queries built in a string in an sp), but wow... That was a first!
 
I think its a problem of timing of the creation of objects. If A refers to B, if you define A first (which is usually allowed, eg procedure A refers to table B), then db cannot record dependency because B does not exist yet (especially because dependencies are by object IDs, not name, no object ID yet).

For SP->Table (not perfect):
Select PAR.Name, CHLD.Name
from Sysobjects PAR, SysComments SC, Sysobjects CHLD
where SC Like '%'+ SO.name +'%'
and CHLD.ID = SC.ID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top