please help create trigger condition on update IF EXISTS (SELECT *FROM empListWHERE (unit = 9))beginupdate [dbo].[empList]set unit = CASE WHEN SELECT na,empID, unitFROM empListWHERE (empID IN (111, 222, 333, 555)) AND (unit = 9))then '4' else t.fld1 end
i have an emmployee table empid unit------------------------------------------------------1111 32222 93333 94444 25555 26666 17777 98888 29999 9-----------------------------i need help create trigger condition on update like thisONLY ON EMPID=2222,3333,7777,9999WHAN ON UPDATE they have unit =9 THAN I NEED THE trigger DO THIS empid unit------------------------------------------------------1111 32222 43333 44444 25555 26666 17777 48888 29999 4 ONLY IF someone update EMPID=2222 OR 3333 OR 7777 OR 9999 and UNIT=9THAN automatic change 9 TO 4 TNX for the help