UPDATE VS4TProductOH SET TPOHTSepCode=(SELECT TSpdTSepCode FROM VS4TProductMethod WHERE VS4TProductOH.TPOHTPdtcode=VS4TProductMethod.TSpdTPDtCode
AND VS4TProductOH.TPOHTSpdStep=VS4TProductMethod.TSpdStep)
WHERE TPOHTSepCode='' OR TPOHTSepCode is null
GO

UPDATE VS4TProductMat SET TPmtTSepCode=(SELECT TSpdTSepCode FROM VS4TProductMethod WHERE VS4TProductMat.TPmtTPdtcode=VS4TProductMethod.TSpdTPDtCode
AND VS4TProductMat.TPmtTSpdStep=VS4TProductMethod.TSpdStep)
WHERE TPmtTSepCode='' OR TPmtTSepCode is null
GO

UPDATE VS4TProductDL SET TPLBTSepCode=(SELECT TSpdTSepCode FROM VS4TProductMethod WHERE VS4TProductDL.TPLBTPdtcode=VS4TProductMethod.TSpdTPDtCode
AND VS4TProductDL.TPLBTSpdStep=VS4TProductMethod.TSpdStep)
WHERE TPLBTSepCode='' OR TPLBTSepCode is null
GO

UPDATE VS4TProductMinor SET TPmrTSepCode=(SELECT TSpdTSepCode FROM VS4TProductMethod WHERE VS4TProductMinor.TPmrTPdtcode=VS4TProductMethod.TSpdTPDtCode
AND VS4TProductMinor.TPmrTSpdStep=VS4TProductMethod.TSpdStep)
WHERE TPmrTSepCode='' OR TPmrTSepCode is null
GO