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.
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.
You can create a trigger to enforce the integrity between the 2 tables in the different dbs.
ASKER
Hi chapmandew,
Very interesting.
How could we do it?
Thank you.
Very interesting.
How could we do it?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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?
ASKER
Ok.
It is safe use kind of trigger?
Thank you.
It is safe use kind of trigger?
Thank you.
sure...
ASKER
Ok.
Thank you very much for your help.
Thank you very much for your help.