Hello,
I have two tables employee and cognosEmpData. I need to match the SSN in both tables and update the personelID column in the employee table if there are matching SSNs. For the remaining non matches,I would like to update the complete record record set from cognosEmpData to employee. Here is what I have so far:
update DBO.employee
set DBO.employee.sSN = DBO.cognosEmpData.SSN
from DBO.cognosEmpData
inner join DBO.employee ON DBO.cognosEmpData.SSN = DBO.employee.sSN
where DBO.employee.personnelID = DBO.cognosEmpData.personnelIDwhere DBO.employee.personnelID = DBO.cognosEmpData.personnelID
I have two tables employee and cognosEmpData. I need to match the SSN in both tables and update the personelID column in the employee table if there are matching SSNs. For the remaining non matches,I would like to update the complete record record set from cognosEmpData to employee. Here is what I have so far:
update DBO.employee
set DBO.employee.sSN = DBO.cognosEmpData.SSN
from DBO.cognosEmpData
inner join DBO.employee ON DBO.cognosEmpData.SSN = DBO.employee.sSN
where DBO.employee.personnelID = DBO.cognosEmpData.personnelIDwhere DBO.employee.personnelID = DBO.cognosEmpData.personnelID