IF ((SELECT IsFaktura FROM VidSmetki WHERE N=5)=0) THEN update VidSmetki set IsFaktura = 1 where N=5 END IF