Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Question Unanswered: External dependencies

    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.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Code:
    select object_name(object_id)
    from sys.sql_modules
    where definition like '%db2%'

  3. #3
    Join Date
    Jul 2011
    Posts
    2
    Quote Originally Posted by MCrowley View Post
    Code:
    select object_name(object_id)
    from sys.sql_modules
    where definition like '%db2%'
    Thanks for the reply..But this query gives me all the dependent object for db2 database but I want to find the dependencies for a particular table (table1)in that db2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •