Code:
UPDATE dbo.employee
SET full_name = t.full_name, cost_center = t.cdcstcntr,
cost_center_desc=t.desccstcntr, job_title=t.job_title,
supervisor=t.supervisor_name
FROM dbo.employee e
JOIN dbo.v_WQTimeEmployees as t
ON t.empUserID = e.NTUserID
INSERT INTO dbo.employee (NTUserID, full_name, cost_center, cost_center_desc, job_title, supervisor)
SELECT t.empUserID, t.full_name, t.cdcstcntr,
t.desccstcntr, t.job_title,
t.supervisor_name
FROM dbo.v_WQTimeEmployees as t
WHERE NOT EXISTS (SELECT *
FROM dbo.Employee e
WHERE e.NTUserID = t.empUserID)
Bookmarks