AZZA-KHAMEES
asked on
Get Result from two diffrent databse
Hello Expert, i am trying to writ an sql statment that retrieve a data from two defrrent databse depend on a condition, will actully can i do this in sql??
i have a table that contain a user id i want to get the full name either from db1.table1 or db2.table1 my sql statement is
SELECT dbo.tblCallDetail.UserId, dbo.tblMinisUser.FullName, pr1.dbo.GetUserDetailsE.En gName
FROM
dbo.tblCallDetail INNER JOIN
dbo.tblMinisUser ON dbo.tblCallDetail.UserId = dbo.tblMinisUser.UserId
AND
dbo.tblCallDetail.UserId = dbo.tblMinisUser.UserId INNER JOIN
pr1.dbo.GetUserDetailsE ON dbo.tblCallDetail.UserId = pr1.dbo.GetUserDetailsE.PE RUserName AND
dbo.tblCallDetail.UserId = pr1.dbo.GetUserDetailsE.PE RUserName
but its wrong sql how can i correct the sql?
i have a table that contain a user id i want to get the full name either from db1.table1 or db2.table1 my sql statement is
SELECT dbo.tblCallDetail.UserId, dbo.tblMinisUser.FullName,
FROM
dbo.tblCallDetail INNER JOIN
dbo.tblMinisUser ON dbo.tblCallDetail.UserId = dbo.tblMinisUser.UserId
AND
dbo.tblCallDetail.UserId = dbo.tblMinisUser.UserId INNER JOIN
pr1.dbo.GetUserDetailsE ON dbo.tblCallDetail.UserId = pr1.dbo.GetUserDetailsE.PE
dbo.tblCallDetail.UserId = pr1.dbo.GetUserDetailsE.PE
but its wrong sql how can i correct the sql?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you :)
ASKER