Results 1 to 3 of 3

Thread: Table Dependencies

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Saudi Arabia
    Posts
    13

    Unhappy


    I have some master tables that other tables reference their PK as a forign key. Good example is "Cities" tables that can be referenced from "Customers" and "Suppliers" tables.

    Now, the question is, is there a away to get a list of those tables that reference "Cities" ??

    I'm using SQL server 7.0, ADO 2.5

    Regards

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122
    exec sp_depends 'tablename'

    Roger

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Saudi Arabia
    Posts
    13

    Ok, I found the answer in another site, here it is:

    SELECT Name FROM SYSOBJECTS,SYSREFERENCES
    WHERE ID = FKEYID
    AND RKEYID = (SELECT ID FROM sysobjects WHERE Name = TableName

Posting Permissions

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



Click Here to Expand Forum to Full Width