The below SQL is working to insert however, I want it to see if the items exists and if they do update them based on the xrefid and the event date for each record.
I am not sure where to begin with this.
;WITH MyCTE AS
EventDate FOR DateDescription in ([Appraisal Ordered],[Closing Date],[Application Signed],[Appraisal Recieved] ,[Approval To Close],[Insurance Ordered],[Title Ordered])
) as unpvt
insert into outlookreport.dbo.calendar (eventdate,item,xrefid)
FROM emdb.dbo.calendarview T
JOIN MyCTE M
ON T.xrefid = M.xrefid