-- Insert read only for Management -> afNoPasswordWxpire
INSERT INTO PersonelAccess (UserIdNumber, AreaFunctionNumber, Access, AreaNumber)
SELECT P.UserIdNumber, 35, CASE WHEN UserIDCode = 'Techotel' THEN 1 ELSE 0 END, 5
FROM Personel P WITH (NOLOCK)
WHERE NOT P.UserIdNUmber IN 
(
  SELECT UserIDNumber
  FROM PersonelAccess WITH (NOLOCK)
  WHERE AreaFunctionNumber = 35
  AND AreaNumber = 5
)