Using `MERGE` would be an ideal way to insert/update when the data present in two different databases.
Sample:
MERGE INTO Destination_Table AS Dest
USING Source_Table AS Source
ON Dest.ID = Source.ID
WHEN MATCHED THEN
UPDATE Dest SET Dest.EmpName = Source.Empname,
Dest.Empdept = Source.Empdept
WHEN NOT MATCHED THEN
INSERT VALUES(
Source.ID
,Source.EmpName
,Source.Empdept);