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
 General SQL Server Forums
 New to SQL Server Programming
 External dependencies

Author  Topic 

virilus
Starting Member

3 Posts

Posted - 2011-07-15 : 15:15:53
I have 11 databases and I want to find the dependecy between the the table of 1 db and the objects of other dbs ..For example suppose there are two DBs db1 and db2. In db1 there is a table called table1 and in db2 there is a procedure called sp_table2. How should I find the dependency between the table table1 and procedure sp_table2.

virilus
Starting Member

3 Posts

Posted - 2011-07-20 : 17:07:52
select object_name(object_id),@dbName
from sys.sql_modules
where definition like '%db2%'

I tried using this but I want to find one to one dependency between tables of different databases
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-21 : 00:46:20
if you're using sql 2008 then use this

http://visakhm.blogspot.com/2010/01/finding-cross-server-cross-db-object.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -