Link to home
Start Free TrialLog in
Avatar of emi_sastra
emi_sastra

asked on

Cross Database Foreign Key Relationship.

Hi,

I have separate database for Master and Transaction.
Due to creating the foreign key of different database, the message shows that it is not supported.

Is there any way (trick) to overcome this beside make them into one database?

Thank you.
Avatar of chapmandew
chapmandew
Flag of United States of America image

You can create a trigger to enforce the integrity between the 2 tables in the different dbs.
Avatar of emi_sastra
emi_sastra

ASKER

Hi chapmandew,

Very interesting.

How could we do it?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see know, manual checking by application or trigger.

When user try to delete the data from the table of Master, then we should check it also it has been used by child table or not?

Thank you.
yes, you'd definetly have to do that too....so, on the master, check for deletes and if they're in the other table.  on the transaction table, make sure any inserts or updates are in the master table...make sense?
Ok.

It is safe use kind of trigger?

Thank you.
sure...
Ok.

Thank you very much for your help.