本文介绍了将RelationShip从一个数据库提供给另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个数据库说DB1,因为我有一个被雇佣者表EmpTable,我维护着被雇佣者记录,并在那里设置了主键.我有另一个DB
说DB2是因为我有一个薪水表,所有Employe的薪水都将被保留.现在,无需再次维护DB2中的受雇者记录,我需要提供从DB1到DB2的关系.那么,我该如何完成这项工作.
在此先感谢
Arun
Hello everyone,
I am having a DB say DB1 in that i am having an employe Table EmpTable where I maintain employe record and I have set a primary key there .I am having a another DB
say DB2 in that I am having a salary table where all Employe salary will be maintained . Now Instead of maintaining again the employe record in DB2 I need to give relation from DB1 to DB2 .So how can I get that thing done .
Thanks in Advance
Arun
推荐答案
SELECT t1.*, t2.*
FROM [DB1].[dbo].[EmpTable] AS t1 LEFT JOIN [DB2].[dbo].[Salary] AS t2 ON t1.EmpID = t2.EmpID
这篇关于将RelationShip从一个数据库提供给另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!