UPDATE aa set Col_Col=
case
when aa.Col_Col is null or aa.Col_Col='' then bb.col_col
else aa.Col_Col
end
--,aa.Col_Col,bb.Col_Col,*
from
(select * from d_col_detail where
CONVERT(varchar(10),Modtime,120)=convert(varchar(10),GETDATE(),120)
and Db_name='EMBASE.EMBase2'
) aa
inner join
(select * from dbo.d_col_detail0312
where ID in (
select ID from d_col_detail where
CONVERT(varchar(10),Modtime,120)=convert(varchar(10),GETDATE(),120)
and Db_name='EMBASE.EMBase2'
) and Col_Col<>'') bb
on aa.Node_name=bb.Node_name and aa.Db_name=bb.Db_name and aa.Tab_name=bb.Tab_name and aa.Col_name=bb.Col_name