rrr
UPDATE ProductModelInfo SET
ExStone=CASE WHEN Sto_Id IS NULL THEN 0 ELSE 1 END
,DisEnable=CASE WHEN SUBSTRING(B.Number,1,1)='2' THEN 1 ELSE 0 END
FROM ProductModelInfo A
LEFT OUTER JOIN DepartmentInfo B ON B.Dept_Id=A.Fy_Id
WHERE [Pm_Id]=@Pm_Id
ExStone=CASE WHEN Sto_Id IS NULL THEN 0 ELSE 1 END
,DisEnable=CASE WHEN SUBSTRING(B.Number,1,1)='2' THEN 1 ELSE 0 END
FROM ProductModelInfo A
LEFT OUTER JOIN DepartmentInfo B ON B.Dept_Id=A.Fy_Id
WHERE [Pm_Id]=@Pm_Id