Displaying relationships on databases/tables

  • Is there a sql command that would list all the relationships on a database or even just a table?

    uanita

  • Try EXEC sp_help '<object name>'

    Full syntax and description in Books Online.

     

    --------------------
    Colt 45 - the original point and click interface

  • HI. I tried sp_help and I don't seem to locate anything about relationships. Am I  reading the output incorrectly?

  • If you run sp_help for a table the foreign key relationships should be at the bottom of the output. If there not there, then maybe they don't exist.

    Another quick method you can use is to create a database diagram. When you get the dialog to select which tables to add, select your table the click the "Add Related Tables Automatically" checkbox.

     

    --------------------
    Colt 45 - the original point and click interface

  • THANKS.. i'll look at my output again and try the diagram method also !!

  • HI.. I did get to try both methods and it does give me the information I need. Thanks so much..!!!

    Juanita

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply