What's faster?
update c
set
c.createdon=q.CreatedOn
,c.createdby=case when q.createdby is not null then q.createdby end
,c.modifiedon=q.modifiedon
,c.modifiedby=case when q.ModifiedBy is not null then q.ModifiedBy end
from crm_annotationbase c
join IncidentWorknote q
on c.annotationid=q.annotationid
or this:
update c
set
c.createdon=q.CreatedOn
,c.createdby=isnull(q.createdby,c.createdby)
,c.modifiedon=q.modifiedon
,c.modifiedby=isnull(q.modifiedby,c.modifiedby)
from crm_annotationbase c
join IncidentWorknote q
on c.annotationid=q.annotationid
I have the first query running for 24 hours already. I'm updating a CRM 2013 table based on staging data.
I'd like to know whether I've chosen the most effecient solution of doing this?