update PU_T_VMIUsedVouchs set bcosting =(case when isnull(iconfirmquantity,0)=0 then 0 else bincost end) 
from warehouse 
where warehouse.cwhcode=PU_T_VMIUsedVouchs.cwhcode and PU_T_VMIUsedVouchs.id=N'1000000066'
go