Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 View dependencies across containers

Author  Topic 

the1gadget
Yak Posting Veteran

55 Posts

Posted - 2008-05-20 : 10:32:07
Hi All

I am trying to get a list of all the dependencies for objects in a database.

I know about sp_depends however many of the objects are not in the catalogue that the object is in and therefore are not shown.

Any help would be useful

--
David

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-20 : 10:38:20
quote:
Originally posted by the1gadget

Hi All

I am trying to get a list of all the dependencies for objects in a database.

I know about sp_depends however many of the objects are not in the catalogue that the object is in and therefore are not shown.

Any help would be useful

--
David




Didnt get that. Can you elaborate? What exactly are you trying to find?
Go to Top of Page

the1gadget
Yak Posting Veteran

55 Posts

Posted - 2008-05-20 : 10:50:06
Hi

To expand.
e.g.
I have a scalar function in one container

FooBar1.dbo.GetText(a,b)

This looks into the following Tables in order and then jumps out when it has found a match.

FooBar1.dbo.Text1
FooBar2.dbo.Text2
FooBar3.dbo.Text3

If you do sp_depends GetText

You get just table back (and the columns it references), and that table is in the same container [Foobar1] and it does not give the tables in the other containers.

So what I would like is a way to get back a list like

FooBar1.dbo.Text1
FooBar2.dbo.Text2
FooBar3.dbo.Text3

--
David


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-20 : 11:02:40
May be try using sp_Msforeachdb 'sp_depends ''GetText'''
Go to Top of Page

the1gadget
Yak Posting Veteran

55 Posts

Posted - 2008-05-20 : 11:18:38
That comes back with a a number of results sets all the same and without any reference to the containers.



--
David
Go to Top of Page
   

- Advertisement -