Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Unanswered: Relations between tables - contraints diagram

    Hi all,
    I have a big problem. I have many tables with constraints, with foreign keys. I need to create a ordered list of tables, on the top must be the basic table what has no parents, then the second level tables (those depends on the first level) the the names of third level etc.

    for example:
    Table A[id]
    Table B[id, idc]
    Table C[id, ida]
    Table D[id, ida]
    Table E[id, idc]

    I tried it by using information_scheme but I was unsuccesfull.

    The result should be:
    A
    C
    D
    B
    E

    Thank you,
    Tom.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There isn't always a relational solution to this problem, because users sometimes create non-linear (aka graphical) relations. I know... Bad user! Naughty user! No donut!

    I worked up an iterative solution, but I don't have it handy. If no one else posts a solution (you still have a copy of that one Rudy?), I'll dig it up and post it, but it might be a day or three.

    -PatP

  3. #3
    Join Date
    Feb 2004
    Posts
    4

    Smile ok

    thank Pat,
    I apreciate your help, I am also working now on a iterative solution, but it does not work. So if you will have a time I will be very glad to see your solution and help, three days or five, does not matter.
    Thanks again.

    Tom.

Posting Permissions

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