harrd007 (7/28/2012)
hi We need to combine two DML Statement into one statment
update B
Set B.phone_disp_new = ISNULL(A.value,'Other')
from test22 B
left outer join test21 A
on B.ph_phone_new = A.TGA_CODE
update B
Set B.phone_disp_old = ISNULL(A.value,'Other')
from test22 B
left outer join test21 A
on B.ph_phone_old = A.TGA_CODE
Can we do it in one update statement?
Is this what you want?
update B
set
B.phone_disp_new = ISNULL(A.value,'Other'),
C.phone_disp_old = ISNULL(B.value,'Other')
from
test22 B left outer join test21 A
on B.ph_phone_new = A.TGA_CODE
left outer join test21 C
on C.ph_phone_old = A.TGA_CODE