UPDATE VS4TDivision Set TDivCostGroup=1 WHERE TDivTCsTAlias='S' and TDivCostGroup is null
GO
UPDATE VS4TDivision Set TDivCostGroup=2 WHERE TDivTCsTAlias='M' and TDivCostGroup is null
GO
UPDATE VS4TDivision Set TDivCostGroup=2 WHERE TDivTCsTAlias='F' and TDivCostGroup is null
GO
UPDATE VS4TDivision Set TDivCostGroup=0 WHERE TDivCostGroup is null
GO
UPDATE VS4TEmployee Set TEmpCostGroup=(SELECT TDivCostGroup From VS4TDivision WHERE VS4TDivision.TDivCode=VS4TEmployee.TEmpTDivCode) WHERE TEmpCostGroup is null
GO
UPDATE VS4TEmployee Set TEmpCostGroup=0 WHERE TEmpCostGroup is null
GO