can we set foreign key from another database
-
here is my problem, please help. I am having 2 databases namely employees and projects. employees database contains a table emp (with fields like empname, etc). projects database contains a table prj (with fields like prjname, prj_leader, etc). but i want to ensure that ALL the prj_leader entries MUST be existing empnames of emp table in employees database. i know that if both the tables are in the same database, it is simple. but i have no idea whether we can set such foreign key constraints across databases. kindly suggest.
-
here is my problem, please help. I am having 2 databases namely employees and projects. employees database contains a table emp (with fields like empname, etc). projects database contains a table prj (with fields like prjname, prj_leader, etc). but i want to ensure that ALL the prj_leader entries MUST be existing empnames of emp table in employees database. i know that if both the tables are in the same database, it is simple. but i have no idea whether we can set such foreign key constraints across databases. kindly suggest.
I’m afraid, its not possible. But,you can use Procedure to ensure this. With regards, Nazmul Hassan Hirok