Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Parent/Child directories in DM

 Post Reply Post Reply
Author
Kouraklis John View Drop Down
New Member
New Member
Avatar

Joined: 10 Apr 2015
Posts: 25
Post Options Post Options   Quote Kouraklis John Quote  Post ReplyReply Direct Link To This Post Topic: Parent/Child directories in DM
    Posted: 29 Jan 2016 at 2:40am
Hi, 

say I have two tables:
Table1:
Table1ID (primary)
...other fields...


Table2:
----------
Table2ID (primary key)
....other fields)
Table1ID <---I want to create a relation to Table1

What I want to do is when a record is deleted/updated in Table2 the corresponding record in Table1 is updated/deleted as well.

Now, in DM, I choose non-id relationship and drag from Table2 to table1. The relation that is created shows Parent --> Table2 and Child --> Table1, which is correct.
Then, the fields that are linked are Table2ID (the primary in table2) to either Table1ID or to a new Table2ID (in table1).

What I want to do is to link Table1ID from Table2 to Table1ID from table 1.

If I drag the relationship from Table1 to Table 2 I can play with the fields the way I describe but the cascade behaviour is not what I want. 

How can I sort this out?

Thanks

John

Back to Top
Kouraklis John View Drop Down
New Member
New Member
Avatar

Joined: 10 Apr 2015
Posts: 25
Post Options Post Options   Quote Kouraklis John Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 2016 at 3:54pm
Sorry, I meand Parent/Child tables
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2362
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 2016 at 9:52pm
I don't think this is possible and it's database design. The cascade occurs the opposite way. If you have Table2.Table1Id foreign key to Table1, then it's the Table2 that will be deleted when Table1 is deleted, not the contrary. I don't think any database will allow you to do what you want without using some trigger/store procedure approach.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down