UPDATE VS4TInventoryMB Set TInMStockId=(SELECT TIMCStockId from VS4TInventoryLOT where VS4TInventoryLOT.TIMCTPdtCode=VS4TInventorymb.TInMTPdtCode
AND VS4TInventoryLOT.TIMCCustom1=VS4TInventorymb.TInMCustom1 AND VS4TInventoryLOT.TIMCLotDate=VS4TInventorymb.TInMLotDate
AND VS4TInventoryLOT.TIMCLotNo=VS4TInventorymb.TInMLotNo AND VS4TInventoryLOT.TIMCSerialNo=VS4TInventorymb.TInMSerialNo)
GO
